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 styles not applied with initial empty value #24087

Closed
RWOverdijk opened this issue Mar 21, 2019 · 6 comments
Closed

[iOS] TextInput styles not applied with initial empty value #24087

RWOverdijk opened this issue Mar 21, 2019 · 6 comments
Labels
Bug Component: TextInput Related to the TextInput component. Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.

Comments

@RWOverdijk
Copy link

RWOverdijk commented Mar 21, 2019

🐛 Bug Report

My TextInput styles aren't applied if my initial TextInput state is an empty string, or if I erase all the content manually and start typing again.

If my TextInput has a value in its initial state, it does apply my styles and I can see the spacing. That is, until I manually (backspace) remove the content and start typing again. Then the spacing is gone.

To Reproduce

I can't reproduce it with a snack. It works as expected there. But, maybe it's a version thing... The versions I'm using are in the Environment section of this ticket.

Here's a gif to demonstrate the behavior I'm seeing:

  1. There's a default value (I set that in state = { text: 'default' })
  2. It works as expected, there's letter spacing.
  3. I remove all text using backspace
  4. Now as soon as I type, the spacing is gone.
  5. This exact same behaviour (no spacing visible) happens when the initial state is empty.

Expected Behavior

I expect my styling to be applied consistently.

Code Example

This is the code. But like I said, it works on expo

https://snack.expo.io/@rwoverdijk/courageous-waffle

Environment

info
  React Native Environment Info:
    System:
      OS: macOS 10.14.2
      CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
      Memory: 774.04 MB / 32.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 10.12.0 - ~/.nvm/versions/node/v10.12.0/bin/node
      Yarn: 1.13.0 - /usr/local/bin/yarn
      npm: 6.4.1 - ~/.nvm/versions/node/v10.12.0/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
      Android SDK:
        API Levels: 21, 22, 23, 24, 25, 26, 27, 28
        Build Tools: 27.0.3, 28.0.3
        System Images: android-25 | Google Play Intel x86 Atom, android-27 | Google Play Intel x86 Atom, android-28 | Google APIs Intel x86 Atom
    IDEs:
      Android Studio: 3.2 AI-181.5540.7.32.5014246
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.8.3 => 16.8.3
      react-native: 0.59.1 => 0.59.1

Sidenote(s)

It took me a lot of time to get the gif the right size on github. Also, the snack name is really cool. I hope that earns this issue some points.

Also, it works as expected on android.

@zhongwuzw
Copy link
Contributor

This should fixed on master but may not released, @RWOverdijk Can you check that?

@RWOverdijk
Copy link
Author

@zhongwuzw Can you point me to the commit you're talking about? I'd gladly check it out.

@zhongwuzw
Copy link
Contributor

I made some commits to fix text input related issues, I think after this #23585?

@RWOverdijk
Copy link
Author

:shipit:

I'm trying to install it now. But yarn add https://github.com/facebook/react-native.git#master is giving me a hard time right now so I'll reply to this once I get it running.

@RWOverdijk
Copy link
Author

@zhongwuzw Yes! That works. All my tests pass. Android, too (make sense since your changes don't touch it).

Any idea when this might get shipped?

@zhongwuzw
Copy link
Contributor

@RWOverdijk Sorry, no idea, but if you wants to apply it ASAP, you can try comment in react-native-community/releases#100, that we may cherry-pick them if possible.

@facebook facebook locked as resolved and limited conversation to collaborators Mar 22, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Mar 22, 2020
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. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants