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

So I feel like we have something close to consensus on the following:

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

We are still discussing the desired behavior for clicking, e.g. using flat-tree-first focusable element vs. tabIndex-order-first element vs. closest-to-cursor focusable element. However, getting this exactly nailed down in the spec seems less urgent, because there will always be user agent discretion involved. We could even leave it explicitly up to the UA in the spec.

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.)

---

If the above is accurate, I propose:

- The spec (i.e. the PR in https://github.com/whatwg/html/pull/4796) be modified in the way @rakina proposes in the OP.
  - Variant: leave click focusing behavior up to the UA, so it can choose between things like closest to cursor, etc. based on what it thinks is useful.
- Chrome's shipping plan:
  - 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.
  - Less urgently, work to align with the spec on click focusing. (This is not an interop issue and UA discretion on determining what is click focusable means we technically can be following the spec either way.)
- Use this repo (probably this thread) to continue discussing use cases for the "potential additions" listed.

Does this sound good? Thoughts on OP vs. the "leave click focusing up to the UA" variant?

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

Received on Friday, 30 August 2019 17:12:51 UTC