You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a53bad8
Browse filesBrowse the repository at this point in the historyBrowse files
* ci: trim prerelease release notes to changesets new since last tag
* fix(native): broaden iOS verticalAlign warning to TextInput
* fix(native): use align-content for vertical-align on rn-web
* feat(showcase): add TextInput vertical alignment widget
* docs(showcase): clarify TextInput alignment summary per-platform
* fix(native): use RN-canonical flex-start/flex-end for align-content emission
Development builds now warn when `vertical-align` is set on a native `<Text>` running on iOS.
5
+
Development builds now warn when `vertical-align` is set on a native `<Text>`or `<TextInput>`running on iOS.
6
6
7
-
React Native 0.85 has no platform API for vertically aligning text inside a fixed-height `<Text>` on iOS, so the declaration silently has no effect there. Android and rn-web continue to render the property as authored. The warning names the situation and points to the workaround: wrap the Text in a View and use `justify-content` for the vertical alignment.
7
+
React Native 0.85 has no platform API for vertically aligning text content inside a fixed-height `<Text>`or `<TextInput>`on iOS, so the declaration silently has no effect there. Android and rn-web continue to render the property as authored. For `<Text>`, the warning points to the workaround: wrap the Text in a View and use `justify-content` for the vertical alignment. `<TextInput>` has no Text-level workaround on iOS today.
`vertical-align: top | middle | bottom` on a styled `<Text>` now positions text content within the Text's box on `react-native-web`, matching the visual semantic of React Native's `verticalAlign` on Android (textAlignVertical). Other `vertical-align` values pass through unchanged so the browser's native baseline-shifting semantics still apply.
'Tall multiline `TextInput` fields with `vertical-align` `top` / `middle` / `bottom`. On Android and rn-web the caret and placeholder should sit at the requested position before any text is typed, and follow the content once the user starts typing. iOS has no `textAlignVertical` API for TextInput in RN 0.85 and the declaration has no effect.',
Copy file name to clipboardExpand all lines: packages/styled-components/src/native/transform/dev.ts
+7-9Lines changed: 7 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -144,14 +144,12 @@ export function warnIfAndroidSkew(value: unknown): void {
144
144
}
145
145
146
146
/**
147
-
* Warn once if `vertical-align` is set on iOS. RN's `Text.js` translates
148
-
* `verticalAlign` to `textAlignVertical` at the JS layer, but iOS Fabric
149
-
* has no `textAlignVertical` handler (the prop only registers on Android
150
-
* via `ReactTextViewManager`). So on iOS the declaration looks like it
151
-
* works but never repositions the glyphs. There is no Text-level
152
-
* workaround in RN 0.85; wrap the Text in a View and use flex
153
-
* justification to vertically align the content within a fixed-height
154
-
* container.
147
+
* Warn once if `vertical-align` is set on iOS. RN's `Text.js` and
148
+
* `TextInput.js` both translate `verticalAlign` to `textAlignVertical`
149
+
* at the JS layer, but iOS Fabric exposes no `textAlignVertical`
150
+
* handler (`ReactTextViewManager` / `ReactTextInputManager` only
151
+
* register the prop on Android). On iOS the declaration looks like it
152
+
* works but never repositions the glyphs or the caret.
155
153
*
156
154
* No-op outside iOS. Callers must wrap in `if (__DEV__)`.
157
155
*/
@@ -166,7 +164,7 @@ export function warnIfIosVerticalAlign(value: string): void {
166
164
if(os!=='ios')return;
167
165
warnOnce(
168
166
'native-vertical-align-ios',
169
-
`\`vertical-align: ${value}\` has no effect on iOS \`<Text>\` in React Native 0.85 (no platform API; the prop only renders on Android and rn-web). To vertically align text within a fixed-height container on iOS, wrap the Text in a View with \`justify-content: <flex-start | center | flex-end>\`.`,
167
+
`\`vertical-align: ${value}\` has no effect on iOS \`<Text>\` or \`<TextInput>\` in React Native 0.85 (no platform API; the prop only renders on Android and rn-web). For \`<Text>\`, wrap it in a View with \`justify-content: <flex-start | center | flex-end>\` to align glyphs within a fixed-height container. \`<TextInput>\` has no Text-level workaround; iOS positions the caret and content at the platform default.`,
0 commit comments