Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Conversation

@OEvgeny
Copy link
Collaborator

@OEvgeny OEvgeny commented Feb 16, 2022

Description

This fixes the following issues found for ArrayField:

  • The field disappears when moving focus back via keyboard (shift+tab)
  • No chance to know current row while using screen reader when a field gets active
  • Unclear focus behavior when pressing "Add new" button: focus stays on the button
  • Multiple fields have the same id

The PR introduces the following changes to fix issues above:

  • Remove field removal on blur because it works unstable. Instead disable "Add new" button until the previous field recieves the value, and remove any empty field in-between fields with values when adding a new empty field
  • Add a region role to array fields with clear aria-label and make the region focusable
  • Place focus on the region when creating a new field via keyboard (focus is not visible when clicking "Add new" via mouse)
  • Add an index to array field ids, so every field has a different id

Task Item

Screenshots

array-field-kb webm

array-field-mouse webm

#minor

This fixes the following issues found for ArrayField:
- The field disappears when moving focus back via keyboard (shift+tab)
- No chance to know current row when a field gets active
- Unclear focus behavior when pressing "Add new" button: focus stays on the button
- Multiple fields have the same id

The PR introduces the following changes to fix issues above:
- Remove field removal on blur because it works unstable. Instead disable "Add new" button until the previous field recieves the value, and remove any empty field in-between fields with values when adding a new empty field
- Add a `region` role to array fields with clear `aria-label` and make the region focusable
- Place focus on the region when creating a new field via keyboard (focus is not visible when clicking "Add new" via mouse)
- Add an index to array field ids, so every field has a different id
@coveralls
Copy link

Coverage Status

Coverage increased (+0.003%) to 55.959% when pulling 8bf8f0c on OEvgeny:a11y/array-field into 749e553 on microsoft:main.

Copy link
Contributor

@tonyanziano tonyanziano left a comment

Choose a reason for hiding this comment

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

I had only one comment, but other than that it looks great 👍

@tonyanziano tonyanziano merged commit 38e387d into microsoft:main Feb 18, 2022
@OEvgeny OEvgeny deleted the a11y/array-field branch February 18, 2022 18:39
@cwhitten cwhitten mentioned this pull request Aug 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants