-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ElementInternals: Add a capability to set the default focus behavior #5120
base: main
Are you sure you want to change the base?
Conversation
This commit introduces 'focusBehavior' IDL attribute of ElementInternals interface. It accepts "unfocusable", "focusable", and "simple-control", and affects focus behavior of ElementInternals' target element. This fixes WICG/webcomponents#762
@alice raises an interesting question at WICG/webcomponents#762 (comment) which I also mentioned at #4607 (comment). How does |
bbaf5fa
to
30e0431
Compare
I pushed some editorial tweaks. The one thing I wonder is whether the normative impacts of an autonomous custom element's focus behavior should show up elsewhere in the spec. Maybe the bulleted list "Elements that meet all the following criteria" in https://html.spec.whatwg.org/#focusable-area ? And we might want to add a sentence near https://html.spec.whatwg.org/#click-focusable, perhaps after the two bullet points saying something like
But, maybe this is all redundant with the sentence you added in https://html.spec.whatwg.org/#tabindex-value. In general the "If the value is null" section there is kind of confusing when compared with the "Elements that meet all the following criteria" in https://html.spec.whatwg.org/#focusable-area, hmm. Thoughts welcome. (Perhaps from @rakina to as our focus spec expert.) |
I agree with adding another explanation for sequential & click focusability. |
- Add a paragraph next to the click focusable definition
Thank you for the comments.
That's a good idea. Done.
I added one sentence to the table in order to link to null tabindex value. What do you think? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great to me. /cc @whatwg/components to get broader input / multi-implementer interest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
WPT PR: web-platform-tests/wpt#21063 |
same as general <span>focusable</span> elements such as <span data-x="editing host">editing | ||
hosts</span>.</p></dd> | ||
|
||
<dt>"<dfn><code data-x="ce-focusBehavior-simple-control">simple-control</code></dfn>"</dt> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per https://whatwg.org/style-guide#tone I don't think we should use this name. Probably best discussed at WICG/webcomponents#762 (comment).
This commit introduces 'focusBehavior' IDL attribute of ElementInternals
interface. It accepts "unfocusable", "focusable", and "simple-control",
and affects focus behavior of ElementInternals' target element.
This fixes WICG/webcomponents#762
(See WHATWG Working Mode: Changes for more details.)
💥 Error: Wattsi server error 💥
PR Preview failed to build. (Last tried on Jan 15, 2021, 7:59 AM UTC).
More
PR Preview relies on a number of web services to run. There seems to be an issue with the following one:
🚨 Wattsi Server - Wattsi Server is the web service used to build the WHATWG HTML spec.
🔗 Related URL
If you don't have enough information above to solve the error by yourself (or to understand to which web service the error is related to, if any), please file an issue.