-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Preact/compat - Input value does not show up in the HTML #2675
Comments
Thank you for reporting this issue. This seems to be (kinda) expected behaviour as we are using different DOM APIs as react does and thus the browser devtools are not updated. Would you mind sharing your usecase where this is an issue? Note that this only affects |
Hi @christianpv! Thanks for the issue, and thanks for the quick and accurate response @sventschui. Just to echo: this is very much working-as-intended. The value of an input should never be reflected in the DOM, doing so is actually a known security vulnerability. Last time I looked into it, React plans to correct this behavior in their next major version. For what it's worth, Preact does correctly render using the |
@developit Thanks for the quick reply. I ran into this issue when I tried to replace React with Preact. Some of our unit tests were not passing due to the value not rendering but this issue is not affecting us anymore since we rewrote the tests. Thanks again! |
Awesome - thanks for the context, that's useful to know. It might be good for us to update the docs to cover this somehow. |
Reproduction
Steps to reproduce
Type "anything" in the email input.
Expected Behavior
Inspecting the input element shows a value of "anything".
Actual Behavior
Inspecting the input element does not show a value.
Note
If the default value is an empty string, the input value appears as an empty string in React.
The text was updated successfully, but these errors were encountered: