Skip to content

fix(ui-time-select,ui-simple-select,ui-select): add missing keyboard …#1991

Merged
ToMESSKa merged 1 commit into
masterfrom
INSTUI-4526_update_the_select_to_include_all_keyboard_interactions_and_aria
Jun 13, 2025
Merged

fix(ui-time-select,ui-simple-select,ui-select): add missing keyboard …#1991
ToMESSKa merged 1 commit into
masterfrom
INSTUI-4526_update_the_select_to_include_all_keyboard_interactions_and_aria

Conversation

@ToMESSKa

@ToMESSKa ToMESSKa commented May 27, 2025

Copy link
Copy Markdown
Contributor

…interactions and fix duplicate SR announcements

INSTUI-4526

ISSUE:

  • in Select, SimpleSelect and TimeSelect, while navigation through the options, an option was announced twice:
    • for VoiceOver, the cause was that while navigating the options with keyboard, the input value updates too, causing the screen reader to announce the changed input value as well
    • for NVDA the cause was that that some of the examples included an Alert, which caused reading option twice
  • in Select, SimpleSelect and TimeSelect, when no option is selected and user presses down arrow, the focus does not jump to the first option as recommended by the official APG patterns
  • in Select, SimpleSelect and TimeSelect, when no option is selected and user presses up arrow, the focus does not jump to the last option as recommended by the official APG patterns
  • for Select, these keyboard interactions were implemented in the examples, while for SimpleSelect and TimeSelect, the source code itself was modified

TEST PLAN:

screenreader annoucements:

  • go through every example in Select, SimpleSelect and TimeSelect, VoiceOver and NVDA should announce an option only once when navigating with down and up arrow buttons: eg 'Alaska not selected' instead of 'Alaska, Alaska not selected'

keyboard interactions:

  • in Select, SimpleSelect and TimeSelect, set the initially selected option to none in the example if needed in order to make the input empty e.g.:
    • In Select set the intial inputValue and selectedOptionId state values to null
    • in SimpleSelect/TimeSelect setting value or defaultValue to value=' ' or defaultValue=' '
  • go through the example with keyboard interactions only
  • when no option is selected initially and user presses down arrow, the listbox should open and the first option should be highlighted and focused (instead of not focusing/highlighting anything)
  • when no option is selected initially and user presses up arrow, the listbox should open and the last option should be highlighted and focused (instead of not focusing/highlighting anything)
  • in SimpleSelect it should work with grouped options and mixed grouped and non-grouped options e.g.: only the last option is a non-grouped option

@ToMESSKa ToMESSKa self-assigned this May 27, 2025
@github-actions

github-actions Bot commented May 27, 2025

Copy link
Copy Markdown
PR Preview Action v1.6.1
Preview removed because the pull request was closed.
2025-06-13 10:10 UTC

Comment thread packages/ui-select/src/Select/README.md Outdated
Comment on lines 128 to 134

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I removed these Alerts as it was the cause of NVDA announcing every option twice

Comment thread packages/ui-select/src/Select/README.md Outdated

@ToMESSKa ToMESSKa May 27, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

with VoiceOver, while navigating the options with keyboard, the input value updates too, causing the screen reader to announce the changed input value and the option as well. This behavior (the input changing while just navigating through options) is not implemented in any official APG examples, so this was removed by the recommendation of Dan.

@ToMESSKa ToMESSKa requested review from balzss and matyasf May 27, 2025 13:16

@matyasf matyasf left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

very nice work! I've found just a smaller issue.

@matyasf matyasf Jun 3, 2025

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This code is a bit misleading, since one might think that this is always a keyboardEvent. This is not the case, this can be either a MouseEvent or a KeyboardEvent. I think the best way would be to check the event.type, e.g.

if (event.type.startsWith('key')) {

BTW we should type these onRequest... functions properly, not just to a generic SyntheticEvent

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I fixed this, check please.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same issue as the code in SimpleSelect

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I fixed this, check please.

…interactions and fix duplicate SR announcements

INSTUI-4526
@ToMESSKa ToMESSKa force-pushed the INSTUI-4526_update_the_select_to_include_all_keyboard_interactions_and_aria branch from f78880c to a2b4fb4 Compare June 4, 2025 13:52
@ToMESSKa ToMESSKa requested a review from matyasf June 4, 2025 14:04
@ToMESSKa ToMESSKa merged commit 0f7ffa5 into master Jun 13, 2025
12 checks passed
@ToMESSKa ToMESSKa deleted the INSTUI-4526_update_the_select_to_include_all_keyboard_interactions_and_aria branch June 13, 2025 10:09
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.

3 participants