-
Notifications
You must be signed in to change notification settings - Fork 125
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 fieldset element #1322
Comments
I think the use of aria-required on a group would be ambiguous. An equally valid reading of a required fieldset is that all of the child fields are required (indeed this is how aria-disabled on a fieldset is specified) |
If aria-disabled on a fieldset is specified, then also aria-readonly should be, see this issue. I agree that this should be also reflected by attribute in host language for all three cases. Therefore flagged this with openui. |
Almost identical response to #542 (comment) IMO, if you want this, it should be an HTML issue, not an ARIA issue... A required state inherited from a container role will never override the host language's "equivalent semantic" attribute in the host language. For example, the absence of |
Based on the previous comment closing |
Thanks for the discussion. I still find this problematic since checkboxes are not tied together in the same way radio buttons are when sharing a name property. There should be a programmatic way to indicate and validate that input to an option in the group is required. I'm not comfortable just leaving that to the text in the legend and it seems disjointed from the way aria is intended to communicate state of elements in a form. |
for what you want, @offsetChris, it would require custom scripting presently and one's own internal rules to determine what was the required amount of checkboxes to check. for instance, i've seen checkbox groupings where one to three of many checkboxes were necessary to check to properly fulfill the requirements of the grouping . simply allowing in contrast, allowing aria-required on a role=radiogroup makes sense because it indicates the grouping must be interacted with, and there is only the possibility for a single radio to be chosen. |
Thanks @scottaohara. I understand your points. To me however the specificity of how many fields are answered would always be custom scripting much in the same way that validating an email address format would be in a text field. That doesn't prevent the field from showing that user input is required. I've always considered |
@scottaohara if there was a checkboxgroup role, it could have almost identical functionality. 'It indicates the grouping must be interacted with, and at least one checkbox must be chosen'. That would address the basic use case: you have a survey or input and you wish to allow someone to indicate one or more responses. As it stands right now, there is no simple way to ensure the user has not missed the question. Yes, if a use case required some more explicit business rule, the author would need to address that. I suspect in a number of such cases, the requirements could be broken down into logical subsets of checkbox groupings, rather than gathering them all into a single group and requiring multiple selections. Regardless, outlier cases for complex logic needn't detract from a clear gap in a common input case. |
@mbgower suggesting a new role is a separate issue though, and out of scope for this thread.
I am not sure if just adding a role would solve this. I don't disagree that there's a gap here, but agree with James Craig. Likely something best to try and take up with HTML first. |
It's considered to be ambigious, as it could mean either that each field in the fieldset is required, or that just a single one (in the case of radio buttons or checkboxes). The suggestion from the spec authors is just te describe the situation in the text, which is what I tried to do in this PR. * The standard: https://w3c.github.io/aria/#aria-required * discussion an github on why that's the case: w3c/aria#1322
might not work. See this closed issue w3c/aria#1322. The guidance on optional and mandatory fields is conflicting
There is not a clear way to denote a required group of input elements, particularly checkboxes. If only one checkbox input is required within a group how can that be communicated to assistive technology that is consistent with non-grouped elements?
Previously explored solutions
Code example with no programatic required denotation
This works to communicate that one check is required, but is not consistent with the implementation for non-grouped elements that would include aria-required or the html required attribute.
Proposed solution
Ideally aria-required could be added to the grouping element to denote the group is required, not the individual input fields.
Please let me know if more information is needed or if there are existing resources I may have missed in the existing documentation.
The text was updated successfully, but these errors were encountered: