w3c / aria

Accessible Rich Internet Applications (WAI-ARIA)
https://w3c.github.io/aria/
Other
630 stars 119 forks source link

Consider adding an `aria-modified` prop so we can mark a field both `aria-required` &/or `aria-modified` #1954

Open fbarroso24 opened 1 year ago

fbarroso24 commented 1 year ago

Description of bug or feature request

The lists of aria props includes an aria-required prop to indicate that user input is required on the element before a form may be submitted. However, I was surprised to find that an aria-modified prop did not exist to denote an input field has been modified.

The only thing I could find regarding modification are props to support live regions to announce changed/inserted content within that region. However, this doesn't provide the granularity required in order to know which inputs have been modified like it does with the aria-required prop.

Use Case We have fields in a form and often times it is useful to inform the users which fields have been modified. This is useful so that they know which fields will be updated if they decide to Save.

Workaround Currently we use a black * positioned before a field label and a red * positioned after a field label to convey a modified &/or required field respectively. This relies on color & location of the * to convey whether a field is required, modified or both. image

However, it'd be great if we could use aria-required & this new aria-modified prop as a 3rd way to convey the modified status for a field given that some screen readers will read the * as either star or asterisk instead of required (e.g. star Name star)

Will this require a change to CORE-AAM?

I'm not sure

Will this require a change to the ARIA authoring guide?

If we add an aria-modified prop then we'd likely need to document it in the list of aria props likely via an anchor like https://www.w3.org/TR/wai-aria-1.2/#aria-modified

spectranaut commented 1 year ago

@scottaohara will link related CSS issue

scottaohara commented 1 year ago

here's but one fo them https://github.com/w3c/csswg-drafts/issues/1533

fbarroso24 commented 1 year ago

@scottaohara @spectranaut thanks for linking the related CSS issue. However, I think it'd still be useful to add an aria-modified prop to the spec given that an aria-required prop already exists and there is no way to mark certain elements as modified.

scottaohara commented 1 year ago

the linking of the issue was not to confirm or deny the usefulness of your proposal. but merely to show there is already a conversation taking place on how one could visually differentiate between a previous/modified state.

fbarroso24 commented 1 year ago

the linking of the issue was not to confirm or deny the usefulness of your proposal. but merely to show there is already a conversation taking place on how one could visually differentiate between a previous/modified state.

@scottaohara got it. Thanks for the clarification.

JAWS-test commented 1 year ago

@fbarroso24 your suggestion would be good to get the concerns out of the way