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

[iOS] TextInput does not scroll to reveal what's being typed #26393

Closed
fjcaetano opened this issue Sep 10, 2019 · 17 comments
Closed

[iOS] TextInput does not scroll to reveal what's being typed #26393

fjcaetano opened this issue Sep 10, 2019 · 17 comments
Labels
Bug Component: TextInput Related to the TextInput component. Platform: iOS iOS applications. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@fjcaetano
Copy link

If a user inputs a large text into a TextInput it's stopping the caret at the last visible position without showing what's being typed by the user.

React Native version:

info Fetching system and libraries information...
System:
    OS: macOS 10.14.5
    CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
    Memory: 534.96 MB / 16.00 GB
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 10.15.3 - ~/.nvm/versions/node/v10.15.3/bin/node
    Yarn: 1.17.3 - /usr/local/bin/yarn
    npm: 6.4.1 - ~/.nvm/versions/node/v10.15.3/bin/npm
    Watchman: 4.7.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
    Android SDK:
      API Levels: 23, 25, 26, 27, 28
      Build Tools: 23.0.1, 24.0.0, 25.0.1, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.2, 28.0.3
      System Images: android-26 | Google APIs Intel x86 Atom, android-28 | Intel x86 Atom, android-28 | Google APIs Intel x86 Atom_64
  IDEs:
    Android Studio: 3.0 AI-171.4443003
    Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.8.6 => 16.8.6 
    react-native: 0.60.5 => 0.60.5

Steps To Reproduce

  1. Create a TextInput and set either prop: value or defaultValue
  2. Add fontSize and lineHeight to the field's style.
<TextInput
  defaultValue='some default value'
  style={{ fontSize: 28, lineHeight: 32 }}
/>

Our investigations have discovered this is an iOS only issue. It appears to happen only for devices without the notch. These were the ones we were able to observe the issue happening:

  • iPhone 8 (12.4)
  • iPhone 8+ (12.1.2)
  • iPhone 7+ (11.4.1)
  • iPhone 6S+ (11.4.1)
  • iPhone SE (9.3.2)

The issue does not occur for Android. We were also able to notice the correct behavior happening on iPhone X and XS Max.

Describe what you expected to happen

The TextInput should scroll to the side revealing what the user is typing.

Example

Run this on iOS: https://snack.expo.io/Sk3hmoHBB

simulator

@kjossendal
Copy link

This, for one reason or another, is caused by the existence of the lineHeight style property.

@Mayzie
Copy link

Mayzie commented Oct 21, 2019

This, for one reason or another, is caused by the existence of the lineHeight style property.

Not for me. It occurs when setting a custom font (fontFamily) and size (fontSize).

@stale
Copy link

stale bot commented Jan 19, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jan 19, 2020
@fjcaetano
Copy link
Author

The issue persists.

@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Jan 21, 2020
@ethanneff
Copy link

The issue still exists on react-native 0.61.5. The current workaround on our team is to remove lineHeight from TextInput.

@anszau
Copy link

anszau commented Feb 4, 2020

In the environment I'm working on this doesn't seem to have anything to do with line height, and instead depends on the fontSize and borderWidth style props.
As far as I can tell, the issue appears when the font size plus two times the border width is above a certain value, which depends on the font family. For example, the default iOS font seems to break at values above 16 (e.g. fontSize: 14, borderWidth: 1), and the font my team is using (Google's Poppins) breaks above 14.

@chrisdrackett
Copy link

it seems to me this can be related to both lineHeight and fontSize. For example in my app if the size is 14 it scrolls correctly with a line height set. If I set the size to 16 it will not scroll until I remove the lineHeight.

@stale
Copy link

stale bot commented Jun 4, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jun 4, 2020
@chrisdrackett
Copy link

still exists as far as I can tell

@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Jun 4, 2020
@stale
Copy link

stale bot commented Sep 2, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Sep 2, 2020
@chrisdrackett
Copy link

still a bug in my testing

@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Sep 3, 2020
@stale
Copy link

stale bot commented Dec 25, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Dec 25, 2020
@chrisdrackett
Copy link

:\

@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Feb 18, 2021
@roryabraham
Copy link

We are encountering this issue too

@fjcaetano
Copy link
Author

If anyone has any clue on how to solve this or even how to troubleshoot it, I'm more than happy to work on a PR, but to be honest, I'm too lost to even know where to begin looking for the cause of this bug

@github-actions
Copy link

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Mar 19, 2023
@github-actions
Copy link

This issue was closed because it has been stalled for 7 days with no activity.

@facebook facebook locked as resolved and limited conversation to collaborators Mar 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Component: TextInput Related to the TextInput component. Platform: iOS iOS applications. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

8 participants