-
Notifications
You must be signed in to change notification settings - Fork 47.5k
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
Bug: Constraint Validation API not reflected on Textarea's value attribute change #19474
Comments
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment! |
I investigated this issue and I believe it is caused by these lines: react/packages/react-dom-bindings/src/client/ReactDOMTextarea.js Lines 76 to 82 in 77c4ac2
Updating the element's This is another problem caused by syncing the Since |
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment! |
I ran into this this week in React, and opened a Chrome bug with a pure JS reproduction before finding this issue: https://issues.chromium.org/issues/333940413 |
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment! |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you! |
Hi,
thank you very much for what you do and you've been doing so far.
I've been working on some form validations via the Validation Constraints API and I've noticed that
event.target.validity
read-only object doesn't get updated and is always valid although some constraints are set when thevalue
attribute is set to theTextarea
.On the other hand, when
value
is passed aschildren
validity
gets updated as expected but I'm being warned toWarning: Use the defaultValue or value props instead of setting children on <textarea>
React version: 16.13.1
Steps To Reproduce
Here's how you can reproduce:
setup this basic app component with one
Textarea
element, set some constraints and add thevalue
attribute as you normally would on any form.add another
Textarea
element but instead of passing value as an attribute pass it aschildren
see code belowOpen your console
Type at least one character into the first
Textarea
see screenshotType at least one character into the second
Textarea
see screenshotThe current behavior
You'll notice that the first
Textarea
ignores the validation constraints setThe expected behavior
Validation constraints should be set and field should be invalid
Link to code example
Please find sample code at https://github.com/tdiluzio/react-dom-textarea-bug
Demo
Here's the URL to the demo https://tdiluzio.github.io/react-dom-textarea-bug/
The text was updated successfully, but these errors were encountered: