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
HTML5 input browser warnings #6992
Comments
@radekmie you should read more about Controlled Component. it does not related to #6441 |
@lionng429 I've read it. Okay, it might be not related to #6441, but how to fix it? Even if |
@lionng429 |
Chrome is trying to be smart. They are warning if you set the invalid value outside of the event handler (the idea being, you are getting your 'value' from your app instead of from the user input, so it should be a valid value). Personally, I think chrome is being overly aggressive with this warning, but that's a design decision. You could file a bug on Chrome if you'd like. Explain your use case, etc. Regardless, this is not a bug in React, and I don't know of anything we could do to mitigate this issue, so I'm going to close it out. |
Thanks @jimfb. |
Wanted to open this again because there seems to be a difference between React 15.1 and 15.3. In 15.1 a controlled React 15.1: http://codepen.io/bradwestfall/pen/ZOqJKm So I guess I'm just wondering if this can be fixed. It's a "chrome thing" but it also appears to be the way react is updating the DOM since they had this solved in a previous version. It's not really a problem for the app, but just super annoying when trying to use the console for meaningful logs and errors |
Στις 5 Αυγ 2016 19:26, ο χρήστης "Brad Westfall" notifications@github.com
|
@bradwestfall |
Thanks @radekmie. But I still don't fully understand. Does this mean a fix is coming or the new behavior is the new status quo? |
Unfortunately I don't know. |
In my render method, I have something like
If I first render this input - no matter what - browser remains silent. When I call
this.setState({input: 'invalid2'})
(or press any with this input focused), it moves cursor at the end and yields a warning:jsfiddle
This might be related: #6441.
It's happening in 15.1.0, I haven't tested any other version.
Is this expected behavior?
The text was updated successfully, but these errors were encountered: