-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Race condition between native browser state and VDom #950
Comments
I deleted my previous comment because I was investigating this late last night, with a fatigued 🧠 . In looking at this again this morning I definitely think there is a bug here. I re-packaged the PR that @Fresheyeball submitted in #955 Mostly I just re-structured the logic in an attempt to make it more clear why the Something that I'm wondering though...is this issue more widespread? I would think any/all boolean properties on DOM elements would be similarly affected ( @jvanbruegge @paldepind would still love another set of 👀 on this and your thoughts. |
I think the special casing on I'm wondering to what extent this is a bug. The diffing process is fundamentally about comparing the previous state of the virtual DOM with the current state of the virtual DOM and applying any differences to the DOM. With this in mind, it is not surprising that problems arise when the state of the DOM is modified both by the browser and by Snabbdom. The current fix for React has a notion of an uncontrolled input and a controlled input and one can choose between the two by choosing between Inspired by what React does, one could have a different subobject in |
Also related #418 (thanks @iambumblehead). |
When hitting a checkbox, there is race condition where the native browser state will set the checkbox to
checked: true
and Snabbom fails to setchecked: false
. Here is a minimal complete exampleReproduction
You can see this bug occur live here: https://plnkr.co/edit/TyvcMBT0F3TQ5YDq
Expected Result
Actual Result
The text was updated successfully, but these errors were encountered: