Skip to content

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

Closed
@RWOverdijk

Description

@RWOverdijk

🐛 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions