Skip to content

Add role="group" to parent element of inputs for accessibility #427

Open
@sarajewett-toast

Description

@sarajewett-toast
  • Describe the Feature Request

Our team's app recently went through an accessibility audit where the OTPInput component was flagged with the following issue:

The 6 digits edit fields are not grouped together programmatically. When radio buttons, checkboxes and other related form controls are visually presented as being grouped but the grouping is not programmatically exposed, users who cannot perceive the visual grouping may not be aware that the controls are related.

  • Describe Preferred Solution

The suggested remediation is to add role="group" to the <div> containing the inputs. This will prompt screen readers to announce each input as a member of the same group.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions