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

Consider allowing aria-required on checkboxes #921

Closed
charmarkk opened this issue Mar 28, 2019 · 5 comments
Closed

Consider allowing aria-required on checkboxes #921

charmarkk opened this issue Mar 28, 2019 · 5 comments

Comments

@charmarkk
Copy link
Contributor

charmarkk commented Mar 28, 2019

During a discussion on the a11y Slack with, the notion of required parity with HTML on checkboxes was raised. Though not often used and a bit odd, there are cases where it is beneficial to have an HTML required attribute on a checkbox and, as such, would benefit from aria-required being allowed in kind.

@jnurthen jnurthen added this to the ARIA 1.3 milestone Mar 28, 2019
@stes-acc
Copy link

We have this for ages in our business frameworks. We need that, too.

@joanmarie
Copy link
Contributor

I don't think this is a parity issue. Parity (1.3) is for us to add attributes that don't exist. We have this attribute. We could apply it now. We need consensus. Therefore I'm removing the 1.3 milestone.

@joanmarie joanmarie modified the milestones: ARIA 1.3, ARIA 1.2 Apr 4, 2019
@joanmarie joanmarie added the F2FCandidate Candidate topics for F2F (or Virtual F2F) meeting label Apr 4, 2019
@jnurthen jnurthen added F2F Topics For F2F (or virtual F2F) and removed F2FCandidate Candidate topics for F2F (or Virtual F2F) meeting labels Apr 24, 2019
@css-meeting-bot
Copy link
Member

css-meeting-bot commented May 2, 2019

The ARIA Working Group just discussed Association List.

The full IRC log of that discussion

<HarrisSchneiderman> During a discussion on the a11y Slack with, the notion of required parity with HTML on checkboxes was raised. Though not often used and a bit odd, there are cases where it is beneficial to have an HTML required attribute on a checkbox and, as such, would benefit from aria-required being allowed in kind

<HarrisSchneiderman> mck: I have 1 question related to how this works...

<jamesn> q+

<HarrisSchneiderman> mck: when you have a group of checkboxes and want at least 1 checked, if you put required on each one it sounds really weird. Is there another way to do that?

<HarrisSchneiderman> jamesn: to step back a bit...what does it mean to have a required checkbox

<HarrisSchneiderman> joanie: required by definition means the checkbox must be checked

<HarrisSchneiderman> mck: you could make a radiogroup required

<HarrisSchneiderman> mck: basically, it is a barrier to going forward

<HarrisSchneiderman> mck: if there's a submit button, and it is disabled until all required fields are "filled out"

<HarrisSchneiderman> mck: there isn't a strong argument I can think of that says "you must not use a checkbox in that situation"

<HarrisSchneiderman> jamesn: A checkbox means I'm saying yes or no to something (not to be confused with the radio example). Both are valid values

<HarrisSchneiderman> jamesn: "No" is an answer just as "Yes" is an answer (or true/false)

<HarrisSchneiderman> mc: An unchecked checkbox could me no, but it could also mean I haven't encounted / interacted with this element

<HarrisSchneiderman> jamesn: 1.3 we potentially could need this

<HarrisSchneiderman> jamesn: in the terms/conditions case, you can have a non-required checkbox with an error message saying "you must check this to continue"

<HarrisSchneiderman> joanie: if we could bring up a list of all required fields with AT, then it'd make sense to see that checkbox in the list because it is a prereq to successful submit

<HarrisSchneiderman> bg: can you use the actual "required" attribute on an html checkbox

<HarrisSchneiderman> jamesn: yes

<carmacleod> From: http://w3c.github.io/html/sec-forms.html#checkbox-state-typecheckbox

<carmacleod> Constraint validation: If the element is required and its checkedness is false, then the element is suffering from being missing.

<carmacleod> http://w3c.github.io/html/sec-forms.html#suffer-from-being-missing

<HarrisSchneiderman> mc: This sounds like an accommodation to HTML from ~30 years ago

<HarrisSchneiderman> mck: I do question some of our current roles that aria-required is allowed on

<HarrisSchneiderman> mck: like gridcell

<HarrisSchneiderman> joanie: but a gridcell can be editable, no?

<HarrisSchneiderman> bg: We changed the definition of that because editable simply means you can change the value, but that doesn't necessarily mean that the element itself is editable

<HarrisSchneiderman> mck: columnheader and rowheader are weird for aria-required

<HarrisSchneiderman> jamesn: you're not saying that this is required, you're saying that you must agree to this one thing

<HarrisSchneiderman> mck: Is html likely to change this?

<HarrisSchneiderman> jamesn: 100% no

<HarrisSchneiderman> mck: not aligning with html will persistently come along and poke us

<HarrisSchneiderman> mck: and sort of hurts our credible

<HarrisSchneiderman> jamesn: the group of checkboxes example is not something we need to solve because there should be some visible text stating how many selections are needed

<HarrisSchneiderman> jamesn: lets assign it to stefan

joanmarie added a commit that referenced this issue May 2, 2019
@joanmarie
Copy link
Contributor

At today's face-to-face we agreed to make this change. I've committed it to master (Editor's Draft). It can land in the Working Draft after we have implementation, tests, authoring, etc. Closing as FIXED.

@jnurthen jnurthen removed the F2F Topics For F2F (or virtual F2F) label Sep 3, 2019
carmacleod pushed a commit that referenced this issue Oct 17, 2019
@mbgower
Copy link

mbgower commented Oct 14, 2020

Just wanted to flag a concern that adding this with no supporting information in the APG risks it being improperly implemented. The only real use case I know of for this is when someone requires a single checkbox to be checked, such as indicating their consent to a statement.
Obviously if someone applied aria-required to each of a set of checkboxes, it would lead to a problematic interaction.

A larger need is for a group of checkboxes to require at least one checkbox to be chosen. If there was an equivalent to radiogroup for checkboxes, that could address that need.

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

No branches or pull requests

6 participants