*Summary*:
Right now the web platform has a UX bug; if the user is focused on an element,
and script changes this element to disabled (e.g. `setAttribute('disabled')`
this results in the element losing focus, with focus typically ending up back
at the top of the document. This is extremely frustrating for users who rely on
only focus for navigation, and as a result developers avoid using the platform
provided disabled functionality, instead inventing their own concepts (such as
using script to set `aria-disabled` and css classes), just to work around this
issue.
We can resolve this; we can retain focus on elements that are disabled, while
updating algorithms for activation & key events to check if an element is
disabled. In other words: follow the pattern that developers reinvent.
A little more detail is provided in
https://github.com/whatwg/html/issues/13159, and of course the spec draft here:
https://github.com/whatwg/html/pull/13170.
I intend to prototype a solution for this, including specs and tests, and
working with developers and users to ensure this is a suitable path forward
before shipping.
*Bug*:
https://bugzilla.mozilla.org/show_bug.cgi?id=2087206
*Specification*:
https://github.com/whatwg/html/pull/13170
*Standards Body*:
WHATWG
*Platform Coverage*:
all.
*Preference*:
`dom.forms.retain_focus_on_disabled.enabled`
*DevTools Bug*:
N/A
*Extensions Bug*:
N/A
*Use Counter*:
I don't think this is necessary but happy to add one if people think it would
be useful.
*Standards-Positions Discussion*:
N/A
*Other Browsers*:
- Blink: Supportive
- WebKit: No signal
*web-platform-tests*:
These will be writing during prototyping.
--
You received this message because you are subscribed to the Google Groups
"[email protected]" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/edf0d2a1-2575-461d-a169-fede9de7e722%40app.fastmail.com.