3 ms·
> Warning: The tabindex attribute must not be used on the <dialog> element. This really needs an explanation
by Matheus28 4y ago
> Warning: The tabindex attribute must not be used on the <dialog> element.
This really needs an explanation
- Someone1234 4y ago"Why this is on MDN?" It is taken from the spec[0]: > The tabindex attribute must not be specified on dialog elements. Why is the spec like that? Uhh, I cannot find a source or explanation. If I had to GUESS, it is because it uses autofocus instead of tabindex to establish focus to the dialog when it is shown. [0]https://html.spec.whatwg.org/multipage/interactive-elements.html#the-dialog-element https://html.spec.whatwg.org/multipage/interactive-elements....
- Izkata 4y agoHere's a long conversation on it from 2016: https://github.com/whatwg/html/issues/1929 https://github.com/whatwg/html/issues/1929 It does seem to have something to do with interfering with automatic focus on the dialog when it pops up as a modal.
- dmitriid 4y agoThe only reason dialog suddenly shipped is because browsers want to remove alert/popup/confirm. Until last year the spec for dialog was in such a state that Chrome (the only ones implementing it) argued that it should be removed. IIRC literally none of the issues were fixed but suddenly it got shipped in all browsers.