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

> * Sequential focus: use the `tabIndex` order
> * .focus(): use the first focusable area in flat tree order by default

Yeah, it seems like we've reached a consensus on these two issues as far as I could tell.

I really don't get the urgency of merging this feature into the HTML spec though. All the involved parties are paying attention to this issue and related PRs so it's not like having this in the HTML specification would speed up any process. If anything, it would create an illusion of the feature being mature to web developers, which is problematic.

> We also are discussing potential additions:
>
> * .focus(): changing the default element focused
> * Clicking: changing the default element focused
>
> Although, it's also been noted that there are alternative ways of accomplishing this, e.g. overriding `.focus()`, or listening for the `focus` event. (My personal favorite would be to add a field to the focus Event object that tells you how the element was focused.)

Adding an option to `focus` do a sequential focus navigation is problematic because that would result in a different element being focused by different UAs. That would lead to many web developers writing code that relies on Chrome's behavior on Windows for example and can cause compatibility issues.

> Work to ship .focus() using the first element in flat tree order. Report back to standards forums if this turns out to be web-incompatible. This is important because it is a potential interop issue.

FWIW, if this turns out be an compatibility issue, we should probably rename `delegatesFocus` to something else instead of spec'ing Chrome's behavior because implementing Chrome's behavior for `focus()` is problematic independent of whether it's Web compatible or not for the reasons I've stated above.

> That proposal doesn't look quite right. We should define the order in which UA should try to find the focusable element on clicking. Then leave it up to the UA to say which elements are focusable that way. (Firefox on MacOS should have quite similar behavior to Safari)

Could you elaborate what you mean by this? Are you suggesting that we should define an order of focusable areas and then UA would pick the first element in which it deems focusable under that ordering? That does sound like a reasonable approach.

-- 
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-527254999

Received on Monday, 2 September 2019 23:04:02 UTC