-
Notifications
You must be signed in to change notification settings - Fork 40
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
preserve input value if no attr change #27
Comments
I've forked your repository and after some experiments my manual tests seem to do what I'd expect. You can find the source here: https://github.com/hesxenon/idiomorph/blob/main/src/idiomorph.js#L350 I'd be glad to open a PR if you agree with the premise of this issue and if you tell me how to run your test suite 😉 - because I only got a conn refused from mocha-chrome 😅 |
hey @hesxenon I htink this should at least be an option. we are in the process of reworking the test suite, are you OK with revisiting it when we are done? Probably early 2025 timeframe? |
sure |
+1 for this. if old element does not have a value and new element does not have a value, user input should not be reset. |
Tested 'ignoreActiveValue' but then buttons was not updating innerHTML when they were focused for some reason Solved my issue with input elements by adding this:
|
Since it is possible(-ish) to work around this feel free to close this issue, but imho the current behaviour around input values is wrong/confusing.
Consider the following structure:
If I type something into this input and then do
I'd expect the inputs value to be preserved since nothing changed and an inputs
value
is only loosely coupled to the attribute of the same name, similar to the play state of a video.According to this part the value of an input is reset if
from
) does not have avalue
attributebeforeAttributeUpdate
callback does not return falseImho it would be better to simplify this to a mismatch in the value attribute like this:
meaning that the behaviour can be depicted as the following table
to
(existing)from
(new content)from
from
The text was updated successfully, but these errors were encountered: