Re: [w3c/webcomponents] Focus delegation from shadow host should not behave like sequential focus navigation (#830)

I was notified, asked to give a comment in this discussion, so let me do it. :)

I remember that I and @TakayoshiKochi  designed and implemented the current behavior.
So I can share some thought here why we choose the current behavior. I hope that might be useful for further discussion!

- There is a use case where web components authors want to control which element in a shadow tree should get focused when a host is *clicked*;  Web component authors don't like if the first clickable element in a shadow tree is always focused.
- If an end-user *clicks* a host, and then hits TAB keys to traverse elements in the component , an end user expects that they can traverse every *traversal* elements in the component. If we introduce inconsistency here, we breaks this expectation. e.g. Suppose that there are 10 elements which can be traversed in the component. If we introduce an inconsistency here, in the worst case, when an end user clicks the host, and hits TAB key, then an end user would escape out of the component without traversing 9 elements. 

I can guess that the current behavior is not perfect, and there is a situation that the current behavior is not desired, however, I think the current behavior should make sense in most use cases with consistent behaviors between *click* and *sequential navigation*.

If we want to address a use case where this default consistent behavior is not desired, I think we should add another API so that it needs a kind of *opt-in* from web component authors.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/830#issuecomment-526434088

Received on Friday, 30 August 2019 02:45:34 UTC