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

Provide a way to set aria-invalid on a file input element #457

Closed
backwardok opened this issue Apr 25, 2023 · 6 comments · Fixed by #464
Closed

Provide a way to set aria-invalid on a file input element #457

backwardok opened this issue Apr 25, 2023 · 6 comments · Fixed by #464

Comments

@backwardok
Copy link

For an <input type="file">, there are many scenarios that would result in an invalid file chosen, whether the file type is incorrect or the file size is too large, or there was an issue with the file itself.

The ARIA in HTML doc indicates that file input types have no role. In ARIA 1.2, aria-invalid is no longer a global attribute. This makes it so that it's not possible to apply the invalid state to a file input type.

It would be great to either revert aria-invalid back to a global property, or to add a file input type role and add it to the list of roles that aria-invalid is supported on.

@stevefaulkner
Copy link
Collaborator

stevefaulkner commented Apr 25, 2023

@backwardok

It would be great to either revert aria-invalid back to a global property

that is the purview of the ARIA spec

or to add a file input type role and add it to the list of roles that aria-invalid is supported on.

hmm

an option, as long as it is exposed by browsers in the acc tree, is to allow it on input type=file
from a quick test on chrome/firefox on windows the invalid state is exposed as expected.

@scottaohara, @patrickhlauke any input on this?

@backwardok
Copy link
Author

backwardok commented Apr 25, 2023

that is the purview of the ARIA spec

Ah I didn't notice that I wasn't filing for the ARIA repo - I will (also?) file a ticket there!

@stevefaulkner
Copy link
Collaborator

@backwardok yeah the scope of the ARIA in HTML spec is

This specification defines the authoring rules (author conformance requirements) for the use of Accessible Rich Internet Applications (WAI-ARIA) 1.2 and Digital Publishing WAI-ARIA Module 1.0 attributes on [HTML] elements. This specification's primary objective is to define requirements for use with conformance checking tools used by authors (i.e., web developers). These requirements will aid authors in their development of web content, including custom interfaces and widgets, which make use of ARIA to complement or extend the features of the host language.

@backwardok
Copy link
Author

Related issue filed for ARIA: w3c/aria#1926

@backwardok
Copy link
Author

From @scottaohara via Slack:

it’s valid on an input type=file, so aria in html needs to be updated to reflect that

Not sure what other ARIA attributes work for <input type="file"> outside of the global set, but sounds like there's at least an issue to update the ARIA in HTML doc to reflect that it can support aria-invalid?

scottaohara added a commit that referenced this issue May 11, 2023
closes #457

`input type=file` can allow for the aria-required, invalid and disabled attributes.  These attributes are already supported by checkers.

Additionally, `input type=color` also allows for the `aria-disabled` attribute.  Note HTML does not allow the required attribute for this element, so aria-required and invalid wouldn't be applicable here.
scottaohara added a commit that referenced this issue May 15, 2023
…uts (#464)

closes #457

`input type=file` can allow for the aria-required, invalid and disabled attributes.  These attributes are already supported by checkers.

Additionally, `input type=color` also allows for the `aria-disabled` attribute.  Note HTML does not allow the required attribute for this element, so aria-required and invalid wouldn't be applicable here.
@backwardok
Copy link
Author

Thank you!

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

Successfully merging a pull request may close this issue.

2 participants