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

> The thing I find particularly strange about the proposed change is that we'd be picking the first click-focusable element, ie sequentially., where order doesn't matter otherwise. At least with Chrome's current behavior the author already expects that tabindex ordering and tree-order matter.

Right, after talking with @s4y I realized that's probably the justification for Chrome's current behavior. That is, Chrome's current behavior allows you to get some control over where focus gets delegated to in all cases, whereas the proposed behavior only gives you such control for sequential focus.

The weird thing is, the way that Chrome's proposed behavior gives you such control  is by co-opting the `tabindex=""` attribute, which previously was about controlling sequential focus, to also control click and programmatic focus.

This gets back to @annevk's point about giving better control, and my comment about it being complicated. It feels the _most_ powerful thing we could do would be three separate APIs, for controlling delegation for each of click, programmatic, and sequential focus, instead of assuming you want the same delegation in all cases.

 But that's tricky in at least two ways:

- [We don't really have that control for the main document](https://github.com/whatwg/html/issues/4607#issuecomment-525823031), so giving that control for shadow children seems strange.
- Any explicit focus control starts to collide with user agents' desires to provide platform-aligned defaults

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

Received on Wednesday, 28 August 2019 16:38:28 UTC