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 long text cut in iOS single line input #14273

Merged
merged 3 commits into from
Jan 13, 2023
Merged
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: 0 additions & 5 deletions src/components/RNTextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ const RNTextInput = props => (
}
props.forwardedRef(ref);
}}

// By default, align input to the left to override right alignment in RTL mode which is not yet supported in the App.
// eslint-disable-next-line react/jsx-props-no-multi-spaces
textAlign="left"

// eslint-disable-next-line
{...props}
/>
Expand Down
5 changes: 4 additions & 1 deletion src/components/TextInput/BaseTextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,10 @@ 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,
!this.props.multiline && {height: this.state.height},

// 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)
!this.props.multiline && {height: this.state.height, lineHeight: undefined},
Copy link
Member

Choose a reason for hiding this comment

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

No inline styles.

Copy link
Contributor

Choose a reason for hiding this comment

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

When the lineHeight is set to 'undefined,' there is a noticeable shift in the input causing it to move by a pixel or two when emoji is added to the input.

Issue: #26735
Platform: Web/Safari

]}
multiline={this.props.multiline}
maxLength={this.props.maxLength}
Expand Down
Loading