Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option role: Change aria-selected from required to supported and remove default value #799

Closed
wants to merge 2 commits into from

Conversation

mcking65
Copy link
Contributor

@mcking65 mcking65 commented Aug 15, 2018

For issue #700, made the following changes to the option role section in index.html:

  1. Remove sentence from description that states there is an default value of false fore aria-selected on option elements.
  2. Remove aria-selected from required states and properties row of attributes table.
  3. Add aria-selected to supported row of attributes table.
  4. Remove default value for aria-selected from implicit values row of attributes table.

Note: This cascades to treeitem so that aria-selected is not required on treeitem.


Preview | Diff

…ve implicit value

For issue #700, made the following changes to the option role section in index.html:

1. Remove sentence from description that states there is an default value of false fore aria-selected on option elements.
2. Remove aria-selected from required states and properties row of attributes table.
3. Add aria-selected to supported row of attributes table.
4. Remove default value for aria-selected from implicit values row of attributes table.

Note: This cascades to treeitem so that aria-selected is not required on treeitem.
@aleventhal
Copy link
Contributor

The way I always understood things were that containers such as listboxes had modes, single selection and multiple selection.
From Core AAM: "In the single selection case, selection follows focus (see the section "Focus States and Events Table" for information about focus events)..."

What this means is that if the author doesn't explicitly put aria-selected="false" on the currently focused item in a single selection container, it will be treated as selected by default. This mimics what you see in native widgets.

@asurkov
Copy link
Contributor

asurkov commented Sep 17, 2018

I think implicit value of aria-selected for role="option" makes sense, since it indicates a presence of selectable state on the element; in contrast to to other non-selectable-by-default roles like role="columnheader".

Agreed, implicit aria-selected="false" sounds confusing in conjunction with "selection follows the focus" case, but probably the sentence should be reworded, something like "role option has an implict aria-selected value of 'false', until it is implicitly selected based on focus (link), in which case it defaults to 'true'.

@melanierichards
Copy link
Contributor

+1 to @asurkov's comment:

I think implicit value of aria-selected for role="option" makes sense, since it indicates a presence of selectable state on the element; in contrast to to other non-selectable-by-default roles like role="columnheader".
Agreed, implicit aria-selected="false" sounds confusing in conjunction with "selection follows the focus" case, but probably the sentence should be reworded, something like "role option has an implict aria-selected value of 'false', until it is implicitly selected based on focus (link), in which case it defaults to 'true'.

@jnurthen jnurthen added the WIP label Nov 27, 2018
@jnurthen
Copy link
Member

@mcking65 This PR has been around for a while. Are there any of these comments that need actioning?

@JAWS-test
Copy link
Contributor

I argue that aria-selected is mandatory, at least for ARIA roles, which by default are intended to be selected like option and tab (see #1094)

@jnurthen jnurthen removed the WIP label Oct 16, 2019
@mcking65
Copy link
Contributor Author

@melanierichards, @asurkov, @aleventhal, we need to account for the situations where authors are using aria-checked instead of selected. I'm not sure what the best way to do this is. I think we should discuss. There is not time to do so for ARIA 1.2.

We also need to discuss whether ARIA needs to support patterns that allow authors to use both checked and selected.

@melanierichards
Copy link
Contributor

cc @boggydigital

@joanmarie
Copy link
Contributor

@jcsteh: We'd like your opinion on this when you have a moment. Thanks!

@jcsteh
Copy link

jcsteh commented Jan 24, 2020

Oo. Quite a conundrum.

Talking only about selection, I agree with @asurkov's #799 (comment). Saying there's no default value is misleading because in a single select widget, options without aria-selected get exposed as selected. In a multi select widget, options without aria-selected get exposed as not selected. ("Not selected" and "doesn't support selection" are two different things.) Doing otherwise is a backwards compat break. So, we should be clear that the default is different depending on single/multiple selection.

On the other hand, the fact that option/treeitem support aria-checked complicates things. It (probably?) doesn't make sense for something to be both selectable and checkable, since they both presumably convey the same meaning, just with slightly different presentation.

My suggestion:

  1. Unless aria-checked is specified, aria-selected should default to true on a single select widget, false on a multi select widget.
  2. If aria-checked is specified, aria-selected has no "default". Open mapping question: should platforms which have the selectable state (or equivalent) stop exposing it in this case? I think this is appropriate.

@sinabahram
Copy link

sinabahram commented Jan 24, 2020 via email

@MarcoZehe
Copy link

On the other hand, the fact that option/treeitem support aria-checked complicates things. It (probably?) doesn't make sense for something to be both selectable and checkable, since they both presumably convey the same meaning, just with slightly different presentation.

I am actually not sure about that. In a single-select tree view, items can be checkable, see certain types of Windows Explorer options or such that have checkable tree items. The Selected state moves along with the focused state, but is definitely there. That item can then be checked or not. Heck, some are even acting like radio buttons, where one of several can be checked at one time.

Where I agree is if a tree has multiple selectable items. Here, I feel like selectable and checkable are going hand in hand, although I currently don't remember ever seeing such a tree view with multiple selection myself. List boxes with option items, yes, and for that, this statement is true I guess as well, e. g. selection and checkmark go together in multi-select scenarios.

@aleventhal
Copy link
Contributor

@jcsteh do you mean the focused option in the single selection case defaults to selected? All of the unfocused options would default to not-selected.

I'm not sure why that rule would need to change due to the presence of checked or not. Honestly, we could probably even get rid of the selection follows focus rule without consequence. I'd be nervous to do so, but the reason it's in there is really historical. We were trying to make listbox/combobox widgets look like they did in MSAA.

@sinabahram
Copy link

sinabahram commented Jan 24, 2020 via email

@jnurthen jnurthen removed the Agenda label Oct 8, 2020
@mcking65
Copy link
Contributor Author

Closing; replaced with #1340

@mcking65 mcking65 closed this Oct 11, 2020
@mcking65 mcking65 deleted the issue700-selected-on-option branch October 11, 2020 02:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.