Skip to content
This repository was archived by the owner on Aug 10, 2022. It is now read-only.

Add focus section to shadow dom article #3255

Merged
merged 3 commits into from
Aug 24, 2016
Merged

Add focus section to shadow dom article #3255

merged 3 commits into from
Aug 24, 2016

Conversation

ebidel
Copy link
Contributor

@ebidel ebidel commented Aug 22, 2016


**Result**

<img src="images/delegateFocusTrue.png" title="delegatesFocus: true behavior">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the blue border supposed to be the default focus outline?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, I want to illustrate the how the styles are affected inside SD and outside of it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That wasn't immediately clear to me. You might add a note mentioning that

@robdodson
Copy link
Contributor

+@alice


The `focus` event will look like it came from `<x-focus>`, not the `<input>`. Similarly, `document.activeElement` will be `<x-focus>`. If the shadow root was created with `mode:'open'` (see [closed mode](#closed)), you'll also be able access the internal node that gained focus:

document.activeElement.shadowRoot.activeElement // only works with open mode.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if the focused element is like 10 shadow roots deep? do I have to keep calling activeElement.shadowRoot.activeElement?

Copy link
Member

@hayatoito hayatoito Aug 23, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we have to call it, recursively, until it reaches the end.

There is no deep version for activeElement.
The issue is filed here WICG/webcomponents#104.

@hayatoito
Copy link
Member

R: @TakayoshiKochi for focus.

@petele
Copy link
Member

petele commented Aug 23, 2016

Looks like there are still some comments. @ebidel can you sort and verify everything looks as it should https://pr-3255-dot-weasel-dot-web-central.appspot.com/ then remove the DO NOT MERGE label and i'll merge and push.

@ebidel
Copy link
Contributor Author

ebidel commented Aug 23, 2016

PTAL

@ebidel ebidel merged commit 5c9c6f8 into google:master Aug 24, 2016
@ebidel ebidel deleted the sdfocus branch August 24, 2016 16:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants