Skip to content

Focus escapes the modal when the last element is focused and has tabIndex="-1" #589

Open
@mvf4z7

Description

@mvf4z7

Summary:

Steps to reproduce:

  1. Create a modal with more than one tabbable elements
  2. Set tabIndex="-1" to the last tabbable element, and focus it programatically
  3. Hit tab one more time, and focus will go to an element outside of the modal

Expected behavior:

The focus should return back to the first tabbable element in the modal

Link to example of issue:

https://stackblitz.com/edit/react-azvpxx

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions