Skip to content

Comments

TextField.js - componentWillReceiveProps - Changing this.props.text t…#32

Open
giladartzi wants to merge 1 commit intoevblurbs:masterfrom
giladartzi:master
Open

TextField.js - componentWillReceiveProps - Changing this.props.text t…#32
giladartzi wants to merge 1 commit intoevblurbs:masterfrom
giladartzi:master

Conversation

@giladartzi
Copy link

…o this.state.text

The scenario is like so:

  1. TextField is focused, but does not have a value.
  2. props are changing
  3. componentWillReceiveProps is triggered, and it's comparing this.props.text to this.props.value.
  4. this.props.text is undefined and does not equal this.props.value which is an empty string
  5. sinkLabel function is called, but TextField is still focused. (This is the issue)

In my opinion, text value should be read from the state and not the props.

Please let me know what you think :-)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant