Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: removed line height from all inputs #15804

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/components/TextInput/BaseTextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,7 @@ class BaseTextInput extends Component {
(!hasLabel || this.props.multiline) && styles.pv0,
this.props.prefixCharacter && StyleUtils.getPaddingLeft(this.state.prefixWidth + styles.pl1.paddingLeft),
this.props.secureTextEntry && styles.secureInput,

// Explicitly remove `lineHeight` from single line inputs so that long text doesn't disappear
// once it exceeds the input space (See https://github.com/Expensify/App/issues/13802)
allroundexperts marked this conversation as resolved.
Show resolved Hide resolved
!this.props.multiline && {height: this.state.height, lineHeight: undefined},
!this.props.multiline && {height: this.state.height},
]}
multiline={this.props.multiline}
maxLength={this.props.maxLength}
Expand Down
9 changes: 7 additions & 2 deletions src/styles/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -767,9 +767,12 @@ const styles = {
}),

baseTextInput: {
// Explicitly remove `lineHeight` from single line inputs so that long text doesn't disappear
// once it exceeds the input space (See https://github.com/Expensify/App/issues/13802)
// Adding lineheight for multiline input should be avoided here because of flickering issue
// on android as per https://github.com/Expensify/App/issues/14799
fontFamily: fontFamily.EXP_NEUE,
fontSize: variables.fontSizeNormal,
lineHeight: variables.lineHeightXLarge,
color: themeColors.text,
paddingTop: 23,
paddingBottom: 8,
Expand Down Expand Up @@ -1400,6 +1403,9 @@ const styles = {

// Be extremely careful when editing the compose styles, as it is easy to introduce regressions.
// Make sure you run the following tests against any changes: #12669
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@allroundexperts please test #12669 as comment says.
I don't think it's related but just to be safe.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aimane-chnaif Android and iOS attached.

Screen.Recording.2023-03-10.at.2.16.05.PM.mov
Screen.Recording.2023-03-10.at.2.18.18.PM.mov

// Adding lineheight should be avoided here
// as per https://github.com/Expensify/App/issues/14799

textInputCompose: addOutlineWidth({
backgroundColor: themeColors.componentBG,
borderColor: themeColors.border,
Expand All @@ -1408,7 +1414,6 @@ const styles = {
fontSize: variables.fontSizeNormal,
borderWidth: 0,
height: 'auto',
lineHeight: variables.lineHeightXLarge,
...overflowXHidden,

// On Android, multiline TextInput with height: 'auto' will show extra padding unless they are configured with
Expand Down