Skip to content

Commit

Permalink
Merge pull request #55711 from software-mansion-labs/kicu/55662-text-…
Browse files Browse the repository at this point in the history
…input-styling

[CP Staging] Fix wrong align of TextInput when displaying currency/icon
  • Loading branch information
luacmartins authored Jan 24, 2025
2 parents 95cc648 + dd30320 commit b51369d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/TextInput/BaseTextInput/index.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ function BaseTextInput(
/>
</>
) : null}
<View style={[styles.textInputAndIconContainer, isMultiline && hasLabel && styles.textInputMultilineContainer, styles.pointerEventsBoxNone]}>
<View style={[styles.textInputAndIconContainer(isMarkdownEnabled), isMultiline && hasLabel && styles.textInputMultilineContainer, styles.pointerEventsBoxNone]}>
{!!iconLeft && (
<View style={styles.textInputLeftIconContainer}>
<Icon
Expand Down
2 changes: 1 addition & 1 deletion src/components/TextInput/BaseTextInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ function BaseTextInput(
/>
</>
) : null}
<View style={[styles.textInputAndIconContainer, isMultiline && hasLabel && styles.textInputMultilineContainer, styles.pointerEventsBoxNone]}>
<View style={[styles.textInputAndIconContainer(isMarkdownEnabled), isMultiline && hasLabel && styles.textInputMultilineContainer, styles.pointerEventsBoxNone]}>
{!!iconLeft && (
<View style={[styles.textInputLeftIconContainer, !isReadOnly ? styles.cursorPointer : styles.pointerEventsNone]}>
<Icon
Expand Down
12 changes: 9 additions & 3 deletions src/styles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1251,9 +1251,15 @@ const styles = (theme: ThemeColors) =>
paddingTop: 23,
},

textInputAndIconContainer: {
zIndex: -1,
flexDirection: 'row',
textInputAndIconContainer: (isMarkdownEnabled: boolean) => {
if (isMarkdownEnabled) {
return {zIndex: -1, flexDirection: 'row'};
}
return {
flex: 1,
zIndex: -1,
flexDirection: 'row',
};
},

textInputDesktop: addOutlineWidth(theme, {}, 0),
Expand Down

0 comments on commit b51369d

Please sign in to comment.