Skip to content

Add definition for Focusable - #39

Closed
carmacleod wants to merge 1 commit into
mainfrom
add-focusable
Closed

carmacleod wants to merge 1 commit into
mainfrom
add-focusable

Conversation

@carmacleod

Copy link
Copy Markdown
Contributor

Add a definition of "focusable" in order to merge w3c/aria#1100.
(No related aria-common issue).

@jnurthen

Copy link
Copy Markdown
Member

I think this is vague enough that it covers the variety of things that user agents actually count as being focusable.

@jnurthen
jnurthen requested a review from sinabahram April 16, 2020 18:07

@cookiecrook cookiecrook left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a good prose suggestion atm, but wanted to raise these.

Comment thread terms.html
</dd>
<dt><dfn>Focusable</dfn></dt>
<dd>
<p>An element is focusable if it can be given the input focus by either the user (for example, using mouse or keyboard) or by script.</p>

@cookiecrook cookiecrook Apr 21, 2020 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By this definition all natively focusable elements will always be exposed to the accessibility tree. Even if you add tabindex="-1" and hide it with ARIA hidden, it's still focusable by a script.

<div aria-hidden="true">
  <a href="#" tabindex="-1">foo</a> <!-- this is focusable -->
  <input tabindex="-1"> <!-- so is this, right? -->
</div>

Also, the definition might need to address concepts such as @inert and/or @disabled

@cookiecrook

Copy link
Copy Markdown
Contributor

Loosely, I think the definition will need to cover the following:

  1. An element that would trigger a native platform "focus" event/notification based on the action of a user (e.g. clicking or tabbing to it)

  2. An element that is only script-focusable should be exposed to the accessibility API at such a time when it is focused and triggers a native system focus event/notification. IOW, the above hidden, non-tabbable link would not be "focusable" but if an author script ever focused it, it would become "focusable" at the time.

  3. Element is not disabled (e.g. via @disabled), possibly a moot point since these are generally readonly and non-focusable.

  4. Element is not inert (e.g. via @inert)... This portion of the ARIA edit should probably be spun off into another issue until the HTML @inert PR is merged and the feature is implemented in multiple engines.

@carmacleod

Copy link
Copy Markdown
Contributor Author

Those 2 aria-hidden="true" tabindex="-1" examples are definitely weird.
https://carmacleod.github.io/playground/focusable-test.html

Chrome puts them in the a11y tree and says they're focusable.
Firefox doesn't put them in the a11y tree at all.
Safari lists them under ignored (hidden) and they're in the tab order??? They say "focused" after you tab to them. Not sure what's going on there.

@cookiecrook

Copy link
Copy Markdown
Contributor

Looping in @alice because she was going to research the reasons for a recent change to the HTML spec that mentions expected behavior of tabindex="-1"

Context for Alice, this new term "focusable" is being added to ARIA with the intention of simplify the text required for the "tree inclusion" portion of the ARIA spec. E.g. ~"among other things, content should be included if it's 'focusable'"

@jnurthen

jnurthen commented Apr 22, 2020 •

Copy link
Copy Markdown
Member

It is worth noting for this discussion that the terminology section in ARIA is informative not normative.

@carmacleod

Copy link
Copy Markdown
Contributor Author

@cookiecrook, some random thoughts:

Is the HTML definition of focusable area helpful here? It mentions "tabindex non-null", and "not inert" and "not disabled" (do we need to also consider not aria-disabled?). That definition also mentions several other focusable things, like shapes in an image map, UA-provided subwidgets of an element, etc, and includes this lovely "catch-all" phrase:

Any other element or part of an element determined by the user agent to be a focusable area, especially to aid with accessibility or to better match platform conventions.

We may not need to wait before including "not inert" in our definition of focusable, because the current definition of the concept of inertness is probably close enough.

I wonder if your point 2 about only including script-focusable elements in the tree on focus might belong over in w3c/aria#1100 so that this definition of focusable can be used in other places in the ARIA spec? I also wonder if point 2 is more of a "user agents MAY", given the inconsistent behavior I noted in the previous comment?

@cookiecrook

Copy link
Copy Markdown
Contributor

Is the HTML definition of focusable area helpful here? It mentions "tabindex non-null", and "not inert" and "not disabled"

I've had a chance to review and I agree that cross-referencing the HTML definition is probably best.

do we need to also consider not aria-disabled?

I don't think aria-disabled affects focus, so no.

I wonder if your point 2 about only including script-focusable elements in the tree on focus might belong over in w3c/aria#1100

Okay. Will unpack this one over there.

@cookiecrook

cookiecrook commented Apr 29, 2020 •

Copy link
Copy Markdown
Contributor

Clarifying: rather than making a new copy of the focusable definition in the ARIA spec, I think the ARIA definition should link to the HTML definition. I think that's what you intended, but I wanted to be clear.

Base automatically changed from master to main January 20, 2021 23:25
@pkra

pkra commented May 15, 2023

Copy link
Copy Markdown
Member

Closing this in favor of w3c/aria#1936

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants