Re: [whatwg/dom] Improving ergonomics of events with Observable (#544)

Besides dispatching custom events by hand, I'm pretty sure there are Web Platform APIs that will synchronously dispatch an event from a method called from JavaScript. For example element.click() or element.focus(). In this case, the micro task queue won't be drained until after returning to the outer level, so `preventDefault()` and `stop[Immediate]Propagation()` won't work properly. In addition, timing may be weird, if an event listener was counting on happening before the default action is performed. For example, if you click() a forms submit button, your Promises won't get to run before the form is submitted so they can't last-minute update form fields.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/544#issuecomment-351764074

Received on Thursday, 14 December 2017 16:35:54 UTC