-
Notifications
You must be signed in to change notification settings - Fork 379
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
[Shadow] Focus on shadow host should slide to its inner focusable node (delegatesFocus) #105
Comments
Moving the focus automatically to an inner-focusable element makes sense to me. Now, once we made the focus to be automatically delegated as proposed on this issue, I can't think of a good reason to keep |
I could see that for But again, since focus in general is poorly explained, it's hard to figure out if |
That's a fair point although that could be easily done by wrapping the shadow DOM contents with |
So you mean that |
Oh, no. I meant that inside the shadow DOM. If you wanted to let the host focused, you could emulate that inside the shadow DOM by wrapping the shadow DOM content in a focusable element. As far as the outer DOM is considered, the host element is the one that has the focus so it won't be able to tell the difference. It's not the most elegant solution but it works... |
I understood you meant inside the shadow DOM. Though I didn't understand you want this multi-level focus thing. Sounds tricky. |
Let me merge without the permissions. I'll close this issue. |
Migrated from https://www.w3.org/Bugs/Public/show_bug.cgi?id=28054
Takayoshi Kochi 2015-02-19 01:46:33 UTC
When a shadow host which is normally unfocusable (e.g.
<div>
), has focusable elements(e.g.
<input>
) in its shadow tree,focus()
ing on the host, or whentabindex
attribute isset on the host and keyboard navigation reaches the host, the focusing behavior should not
stop on the host but slide to its inner shadow tree if any elements in the shadow tree is focusable.
Without this default behavior, if a developer wants to emulate e.g. with a shadow DOM, some tricky workarounds are needed or at least exposing HTML "tab focusable flag" on an element.
This is not specified in the shadow DOM spec as of now, but this behavior should be
more convenient for a component developer.
Example1:
In this case,
$("host").focus()
or hitting TAB from#input-A
, focus should move to#inner
, rather than#host
.In reverse order, hitting Shift + TAB from
#input-B
should move to#inner
, then#input-A
.This is the new behavior that this bug is proposing.
Example2:
In this case,
$("host").focus()
or hitting TAB from#input-A
, focus should move to#host
.This is an existing behavior.
Example3:
In this case,
$("widget").focus()
or hitting TAB from#input-A
, focus should move to#widget
.This is also an existing behavior.
This came up from conversation with Ian Hickson over the shadow DOM tabindex focus behavior document.
The text was updated successfully, but these errors were encountered: