uswds / uswds-site

USWDS website and documentation
https://designsystem.digital.gov
Other
183 stars 140 forks source link

USWDS-Site - Guidance: Avoid adding non-tabbable items to focus-trap components #2675

Open mahoneycm opened 1 month ago

mahoneycm commented 1 month ago

Summary

Add guidance to prevent devs from including non tabbable elements in focus trap components

Problem statement

USWDS bug reported in uswds/uswds#5831

Including a non-tabbable element within a focus-trap component, such as modal, causes the focus to escape the element and focus other elements that should be prevented from being focused.

Proposed solution

While we address the root issue, we should consider guidance that will help to prevent developers from adding non-tabbable items to modal (or other components that use focus-trap )