I ran into weird problem when listening to form reset
event.
Inside callback of reset
event I check for input value, and it's not updated immediately, I have to wait until next tick, for example with setTimeout(callback, 0)
or preventing default and triggering event manually with el.reset()
Here is jsbin example so you can see what I'm talking about - after you insert some value into input and click reset button, no content should be added to div
element.
I can see the same problem on Chrome as well as Firefox.
- Is it a bug in implementation or intended behavior?
- If the latter – why?
- Is there any better way to workaround it than doing setTimeout or preventing default and triggering event manually?