Skip to content

Conversation

taysea
Copy link
Collaborator

@taysea taysea commented Apr 15, 2025

What does this PR do?

Adds combobox props to MaskedInput (similar to TextInput logic).

Slight modifications to the logic so that each mask section can appropriately inform screen reader if it's expanded.

According to ARIA documentation, an "id" is needed to associate the input with the combobox, so added "id" to the stories in MaskedInput and TextInput that involve the suggestions.

Where should the reviewer start?

https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/combobox_role

What testing has been done on this PR?

Locally in SizeUnits story with VoiceOver.

How should this be manually tested?

Same as above.

Do Jest tests follow these best practices?

  • screen is used for querying.
  • The correct query is used. (Refer to this list of queries)
  • asFragment() is used for snapshot testing.

Any background context you want to provide?

What are the relevant issues?

Closes #7573

Screenshots (if appropriate)

Do the grommet docs need to be updated?

Should this PR be mentioned in the release notes?

Yes. Fixed MaskedInput to support combobox aria properties for dropdown options.

Is this change backwards compatible or is it a breaking change?

Backwards compatible.

@taysea taysea marked this pull request as ready for review April 15, 2025 18:41
@taysea taysea requested a review from MikeKingdom April 15, 2025 18:41
Copy link
Collaborator

@MikeKingdom MikeKingdom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@taysea taysea requested a review from jcfilben April 15, 2025 21:44
Copy link
Collaborator

@jcfilben jcfilben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we are missing an id in the MaskedInput Date, DateRange, and Filtered stories

Copy link
Collaborator

@jcfilben jcfilben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when I arrow through the items in the drop it reads out the item and says 'completion selected', I'm confused why it is reading that out
Screenshot 2025-04-16 at 1 44 34 PM

@taysea
Copy link
Collaborator Author

taysea commented Apr 16, 2025

completion selected

I believe that is the automatic readout that happens when you've selected something and then it's active again. For example, here's what happens in Headless UI combobox

Screenshot 2025-04-16 at 1 28 38 PM

@taysea taysea requested a review from jcfilben April 16, 2025 20:29
@jcfilben
Copy link
Collaborator

I believe that is the automatic readout that happens when you've selected something and then it's active again. For example, here's what happens in Headless UI combobox

It seems like it announces that even when I haven't selected anything previously. Just seems a little odd.

@jcfilben
Copy link
Collaborator

Taylor and I chatted more about the 'completion selected' announcement. Seems like something was changed recently in voiceover with this behavior. It also isn't consistent in how it reads out even with suggestion drop downs outside of Grommet. This behavior seems outside of our control so leaving things as they are for now.

Copy link
Collaborator

@jcfilben jcfilben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@jcfilben jcfilben merged commit d15a6f6 into master Apr 16, 2025
15 of 16 checks passed
@jcfilben jcfilben deleted the fix/maskedinput-combobox branch April 16, 2025 22:01
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 this pull request may close these issues.

MaskedInput -- Should announce when masked options drop is open
3 participants