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

Inconsistent allowed roles for "button" elements #395

Closed
scottaohara opened this issue Jan 15, 2022 · 2 comments · Fixed by #446
Closed

Inconsistent allowed roles for "button" elements #395

scottaohara opened this issue Jan 15, 2022 · 2 comments · Fixed by #446
Assignees
Labels
Allowed roles Pertaining to the allowed roles of HTML elements Clarification needed Revise or expand the information provided Inconsistency Inconsistency in allowances between similar HTML/ARIA features.

Comments

@scottaohara
Copy link
Member

scottaohara commented Jan 15, 2022

This issue was filed while creating the PR to address #375.

input type=image is a graphical version of input type=submit.

The latter, along with input type=reset does not allow for any role.

The former, along with the button element and input type=button allow for specific roles.

A button element defaults to type=submit if the type attribute is missing. The spec does not distinguish the different button types though.

Right now the spec is inconsistent with when these rules apply, so I propose the following:

Make input type=submit, input type=reset, input type=button, input type=image, and button all have the same allowances if not a descendant of a <form> or associated with a <form>. Otherwise, surface a warning that authors SHOULD use type=button or ensure that the implicit submit/reset functionality of the control has been suppressed.

cc @stevefaulkner, @patrickhlauke

@scottaohara scottaohara added Allowed roles Pertaining to the allowed roles of HTML elements Clarification needed Revise or expand the information provided Inconsistency Inconsistency in allowances between similar HTML/ARIA features. labels Jan 15, 2022
@scottaohara scottaohara added this to the ARIA in HTML: Next milestone Jan 15, 2022
@patrickhlauke
Copy link
Member

Make input type=submit, input type=reset, input type=button, input type=image, and button all have the same allowances if not a descendant of a <form> or associated with a <form>. Otherwise, surface a warning that authors SHOULD use type=button or ensure that the implicit submit/reset functionality of the control has been suppressed.

the second part of that warning won't make much sense for <input type="image"> though as changing it to type="button"` makes it not be an image input anymore?

@scottaohara
Copy link
Member Author

yeh. someone would have to do <button type=button><img ...></button>

scottaohara added a commit that referenced this issue Feb 6, 2023
closes #444
closes #395
closes #298

This PR makes the allowances for button-elements (button, input type=button|image|submit|reset) more consistent with each other.  Additionally, slider and gridcell are now listed under the allowed roles for these elements.

the LOE to properly create the necessary UX for some of these roles when specified, especially on the `input` type buttons, is rather large _but_ possible.  Any failures to not implement these properly would be caught by WCAG rules.  Allowing the roles won't change that.
scottaohara added a commit that referenced this issue Jul 5, 2023
* Update button and input button type allowances

closes #444
closes #395
closes #298

This PR makes the allowances for button-elements (button, input type=button|image|submit|reset) more consistent with each other.  Additionally, slider and gridcell are now listed under the allowed roles for these elements.

the LOE to properly create the necessary UX for some of these roles when specified, especially on the `input` type buttons, is rather large _but_ possible.  Any failures to not implement these properly would be caught by other WCAG rules and likely other automated checks.

* add missing slider allowance for input type=image
* add changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Allowed roles Pertaining to the allowed roles of HTML elements Clarification needed Revise or expand the information provided Inconsistency Inconsistency in allowances between similar HTML/ARIA features.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants