w3c / uievents

UI Events
https://w3c.github.io/uievents/
Other
145 stars 52 forks source link

Need algorithm for how focus events are fired #195

Open garykac opened 6 years ago

garykac commented 6 years ago

We need a algorithmic description of how focus events are fired.

blur, focus, focusin, focusout

It should also cover: DOMFocusIn and DOMFocusOut

Starting point:

<User shifts focus>
1   focusin Sent before first target element receives focus
2   focus   Sent after first target element receives focus
3   DOMFocusIn  (If supported)
<User shifts focus>
4   focusout    Sent before first target element loses focus
5   focusin Sent before second target element receives focus
6   blur    Sent after first target element loses focus
7   DOMFocusOut (If supported)
8   focus   Sent after second target element receives focus
9   DOMFocusIn  (If supported)
garykac commented 6 years ago

See https://w3c.github.io/uievents/#events-focusevent-event-order

domenic commented 6 years ago

Likely this would replace either part or all of https://html.spec.whatwg.org/#focus-update-steps. Unsure on the exact best division of labor/specs, but happy to help figure it out.