Skip to content

Commit b51369d

Browse files
authored
Merge pull request #55711 from software-mansion-labs/kicu/55662-text-input-styling
[CP Staging] Fix wrong align of TextInput when displaying currency/icon
2 parents 95cc648 + dd30320 commit b51369d

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

src/components/TextInput/BaseTextInput/index.native.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ function BaseTextInput(
306306
/>
307307
</>
308308
) : null}
309-
<View style={[styles.textInputAndIconContainer, isMultiline && hasLabel && styles.textInputMultilineContainer, styles.pointerEventsBoxNone]}>
309+
<View style={[styles.textInputAndIconContainer(isMarkdownEnabled), isMultiline && hasLabel && styles.textInputMultilineContainer, styles.pointerEventsBoxNone]}>
310310
{!!iconLeft && (
311311
<View style={styles.textInputLeftIconContainer}>
312312
<Icon

src/components/TextInput/BaseTextInput/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ function BaseTextInput(
309309
/>
310310
</>
311311
) : null}
312-
<View style={[styles.textInputAndIconContainer, isMultiline && hasLabel && styles.textInputMultilineContainer, styles.pointerEventsBoxNone]}>
312+
<View style={[styles.textInputAndIconContainer(isMarkdownEnabled), isMultiline && hasLabel && styles.textInputMultilineContainer, styles.pointerEventsBoxNone]}>
313313
{!!iconLeft && (
314314
<View style={[styles.textInputLeftIconContainer, !isReadOnly ? styles.cursorPointer : styles.pointerEventsNone]}>
315315
<Icon

src/styles/index.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,9 +1251,15 @@ const styles = (theme: ThemeColors) =>
12511251
paddingTop: 23,
12521252
},
12531253

1254-
textInputAndIconContainer: {
1255-
zIndex: -1,
1256-
flexDirection: 'row',
1254+
textInputAndIconContainer: (isMarkdownEnabled: boolean) => {
1255+
if (isMarkdownEnabled) {
1256+
return {zIndex: -1, flexDirection: 'row'};
1257+
}
1258+
return {
1259+
flex: 1,
1260+
zIndex: -1,
1261+
flexDirection: 'row',
1262+
};
12571263
},
12581264

12591265
textInputDesktop: addOutlineWidth(theme, {}, 0),

0 commit comments

Comments
 (0)