Re: [csswg-drafts] Please add "tab-index" to CSS specification

I agree that there is a need for controling the tabing order. As you said, layout can change the visual order of things. Often, it is still better to keep the tab order in the logical document order, but sometimes it is useful to reorder.

Since it depends on layout, I agree it should be done in css.

However, I don't think `tab-index` / `nav-index` is the right solution: the index is global to the page, so you need to be aware of all elements on the page to pick your number correctly, which is a huge pain. Its's been proposed before, and was removed as people (including browsers vendors) did not like that solution.

But that doesn't mean we don't need a solution. We do.

An alternative has been discussed, but not yet specified: `nav-next` and `nav-pre`. They would work with the same syntax as `nav-up`, `nav-down`, `nav-left`, and `nav-right` (see https://drafts.csswg.org/css-ui-4/#nav-dir).

This also allows you to reorder elements for tab navigation, but instead of needing to figure out a global order in your page, you can simply change the order locally. Specifying this is in my todo list.

It is used differently than `tab-index` / `nav-index` so it may take some time to get used to, but I hope that ends up being more usable and useful.

I understand it may be a little hard to evaluate without a full specification, but if you understand the idea, I'd appreciate your feedback about whether this seems like it would solve your use case, or whether you think it would have issues.

-- 
GitHub Notification of comment by frivoal
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1748#issuecomment-323990372 using your GitHub account

Received on Tuesday, 22 August 2017 10:49:30 UTC