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
Button with role="switch" pronounced as checkbox. #11310
Comments
|
cc: @feerrenrut, @LeonarddeR is there a way to fix this in NVDA? Actually this element can be navigated by pressing b in browse mode, so it could cause confusions if it is still not pronounced correctly. |
|
Switches are visually buttons, and functionally checkboxes... What I feel is much more problematic in the current implementation - and demonstrated by the provided example - is that NVDA does not announce the value embedded in the Switch Button. This value can carry important information. Narrator.does announce it. |
|
The mapping of Switch Button to the checkbox role has been established for IA2 as of issue #9187 / PR #10782. According to #9187 (comment), proper support for A uniform stance, reducing the behavioral gap between the different supported browsers would IMHO be much preferable. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
IMO, toggle button isn't any better than check box. If anything, it's worse because buttons normally have pressed/not pressed states, rather than checked/not checked. You note that the spec says "a type of checkbox", but you then say "it is not a checkbox". If it's a type of checkbox, it is by definition a checkbox, albeit slightly different to a vanilla checkbox. Then there's the question of whether it's useful (or even harmful) for users to understand the difference between a checkbox and a switch, especially on desktop. Desktop screen reader users know what a checkbox is. Do they know what a switch is and how to interact with it? Does understanding this difference help users or just give them more things to learn, making the already steep learning curve that tiny bit steeper? Just my thoughts; this really isn't my decision. In terms of implementation, if it was decided to change this, we'd need a new NVDA ROLE_SWITCH. We might also need new states for on/off, or alternatively, speech/braille would somehow need to know to present checked/not checked as on/off for a switch. Finally, NVDAObjects.IAccessible.ia2Web.Switch would need to be updated accordingly. |
This applies to all check boxes and was a show stopper for #8858 to use the values for the remaining columns after the first columns The problem is, how to guarantee that the value has meaningful information? Some implementation expose the checked/unchecked state as 0/1 in the accValue, and that's really redundant information. May be this is worth a separate issue? |
|
I don't know what is meant by "value" here. An ARIA checkbox can't specify a value. Narrator says on and off for switches instead of checked/not checked, but that's just how Narrator pronounces switches. |
The confusion may interfere when collaborating with a sighted party.
Indeed, but a switch can, and its value is currently unavailable to NVDA users.
Do you know which implementations? Could we black- or white- list this? Or filter out obvious redundancies? |
|
An ARIA switch cannot specify a value according to the spec:
https://w3c.github.io/aria/#switch
Note that aria-valuetext is not listed as a supported attribute. Note also that nothing maps to accValue in the mapping spec for switch:
https://w3c.github.io/core-aam/#mapping_role_table
|
|
If you're referring to the text content inside the tag, that is not a value. In fact, the spec says that children of a switch are presentational; they relate only to how the control is presented visually. |
This comment was marked as off-topic.
This comment was marked as off-topic.
|
It looks this issue is stuck. There is some debate about whether this change should be made, though it does look like it could be made. There is also the discussion on W3C about how switches should be exposed: w3c/core-aam#75 I think this probably should be exposed to the user, since it encourages using a common language when talking about the control, and differentiates a two state switch from a three state (checked, not checked, indeterminate) checkbox |
This comment was marked as off-topic.
This comment was marked as off-topic.
|
On the whole I think this should go ahead, summary of reasoning giving in this thread (for and against):
The note on https://www.w3.org/TR/wai-aria-1.2/#switch also reflects this.
#10644 is also related. |
|
Blocked by an internal or external decision discussed in w3c/core-aam#75 |
…4282) Fixes #11310 Summary of the issue: Currently elements on the web with an ARIA role of "switch" are presented in NVDA as checkboxes. This is because: • There is no switch role in IAccessible2 • ARIA practices recommend that browsers map the switch role to the toggleButton role in IAccessible2, but there is some confusion around whether the pressed or checked state should be exposed to denote the switch is on. • NVDA historically has chosen to deliberately map switches to checkboxes with checked, rather than toggleButton with pressed. • ARIA practices state that a switch is the same as a checkbox, just with no indeterminate state. There is a lot of pressure from web authors and standards groups for NVDA to specifically report switch controls as having a role of "switch" rather than checkbox, as it is believed this improves communication between blind and sited individuals, as visually the switch control looks like a switch, not a checkbox. Description of user facing changes • switch controls in Firefox, Chrome and Edge, via IAccessible2, are now reported in NVDA as switch controls, rather than checkboxes. ◦ They are spoken with a role of "switch" and state of either "on" or "off". ◦ In Braille, they are represented with a role of "swtch" and a state braille pattern the same as checked / not checked. Description of development approach • Added a new role of SWITCH • Added a new state of ON • The negative state of ON is "off". • Only a role of switch forces a negative of the ON state. I.e. Switch is the only control that will report as "off" if no ON state exists. • The switch role is treated as having a text presentation type of singleLine, similar to checkbox. • for IA2Web NVDAObjects and IAccessible2 virtualBuffers (Chrome, Firefox, Edge), IAccessible2 objects with "switch" in xml-roles: ◦ map to an NVDA role of switch ◦ pressed and checkable states are discarded ◦ the checked state is mapped to the ON state. The w3c ARIA examples submodule has also been updated to the latest main commit as the existing commit we were on did not yet have the switch example.
When navigating to a
<button>withrole="switch", it will be pronounced as a checkbox. It is recognized as a toggle button or switch button by accessibility APIs for example, but it is not pronounced as such.https://www.w3.org/TR/wai-aria-1.2/#switch does state "A type of checkbox that represents on/off values", but it is not a checkbox and has a seperate role. I think it should be pronounced differently.
https://www.w3.org/TR/wai-aria-1.1/#switch does mention "Role: ROLE_SYSTEM_CHECKBUTTON" which might be the cause, but it also states "Object Attribute: xml-roles:switch" which hopefully means thiscan be fixed.
Steps to reproduce:
<button>withrole="switch"Actual behavior:
Button is announced as "Checkbox".
Expected behavior:
Button is announced as "Switch", or something alike.
System configuration
NVDA 2020.1 installed on Parallels. Chrome version 83. Windows 10.
The text was updated successfully, but these errors were encountered: