Skip to content

iOS TextInput color does not change with re-render #14842

Description

@trblandford4

Is this a bug report?

Yes

Have you read the Bugs section of the Contributing to React Native Guide?

Absolutely

Environment

  1. react-native -v: react-native-cli: 2.0.1 react-native: 0.45.1

  2. node -v: v7.7.2

  3. npm -v: 4.1.2

  4. Target Platform (e.g. iOS, Android): iOS

  5. Development Operating System (e.g. macOS Sierra, Windows 10): macOS Sierra

Steps to Reproduce

  1. Create a TextInput and a Button.
  2. Create a StyleSheet with two separate and distinguishable styles for the TextInput
  3. Create a state boolean to select between the styles
  4. Create a style variable that selects between the styles based on state var from step 3.
  5. Create a button with a function that set's the state to change the TextInput's style onPress
  6. Click button
  7. Watch iOS not work. 😭

Expected Behavior

All style changes (color, backgroundColor, etc.) are applied to TextInput when the component is re-rendered after a state change.

Actual Behavior

TextInput text color changes after first button press, but does not change on subsequent presses.
However, all other styling changes are applied as the component re-renders.

Reproducible Demo

https://snack.expo.io/SJKDa6q4Z

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions