elm / virtual-dom

The foundation of HTML and SVG in Elm.
https://package.elm-lang.org/packages/elm/virtual-dom/latest
BSD 3-Clause "New" or "Revised" License
209 stars 80 forks source link

Synchronous events (stopPropagation) with DOM change lose update commands (Cmd) #152

Closed rague closed 4 years ago

rague commented 5 years ago

SSCCE : https://ellie-app.com/53SFy34Wg7da1

Click in the first input (Working), then press a key. In the console, you'll see "hide" and "blur" "hide" and "blur" have been sent to the console with a port.

Click "Show", then in the second input (Not Working). Press a key. You won't see "hide", just "blur". In this case, we used a stopPropagationOn handler. The message have been sent, but not the command of the update function. If you comment line 58 (", onBlur Blur"), it works (you'll see "hide" when you press a key)

KasMA1990 commented 4 years ago

I ran into a similar issue in my own code. The problem I ran into only occurred in Chrome, but the SSCCE attached here seems to also behave differently in Firefox and Chrome (with neither being correct). I only got here with help from @rlefevre who also found this issue, which seems to be related: https://github.com/elm/virtual-dom/issues/146

decioferreira commented 4 years ago

This should now be solved with the new version elm/core@1.0.5. should this now be closed?

rague commented 4 years ago

Solved, thank you !