Skip to content

Accessibility: Focusable elements outside of the modal #6842

@OlivierMartinez

Description

@OlivierMartinez

Prerequisites

Describe the bug

While the React Bootstrap modal is open, moving around with the keyboard using Tab, focuses on elements outside of the modal. Pressing TAB while navigating the modal should not result in the focus being put on element outside of the modal.

Expected behavior

A user that use the keyboard to navigate a website and open a modal, should get his focus trapped within that modal until he press 'ESC' or the close button.

To Reproduce

  1. Navigate to a button opening a modal with TAB
  2. Hit enter
  3. Using TAB you can see that the focus gets out of the modal

Reproducible Example

https://react-bootstrap.netlify.app/docs/components/modal

Screenshots

No response

What operating system(s) are you seeing the problem on?

Windows

What browser(s) are you seeing the problem on?

Chrome

What version of React-Bootstrap are you using?

v2.10.4

What version of Bootstrap are you using?

5.3

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions