Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dialog: Focus trap issue with multiple dialogs #3256

Closed
Vampiro opened this issue Sep 7, 2022 · 1 comment · Fixed by #3257
Closed

Dialog: Focus trap issue with multiple dialogs #3256

Vampiro opened this issue Sep 7, 2022 · 1 comment · Fixed by #3257
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@Vampiro
Copy link

Vampiro commented Sep 7, 2022

Describe the bug

If 2 Dialog components are open at once (one brought up from a button in the first Dialog) and the prop closable={false} is on the nested Dialog, tab button navigation fails to focus on the fields of the nested Dialog, instead preferring fields in the parent Dialog component. Not having prop closable={false} allows tab navigation of the fields in the nested Dialog.

Reproducer

https://codesandbox.io/s/primereact-dialog-tab-issue-9uw81h?file=/src/index.js

PrimeReact version

8.4.0

React version

18.x

Language

ALL

Build / Runtime

Create React App (CRA)

Browser(s)

Chrome 104

Steps to reproduce the behavior

In the provided CodeSandbox:

  1. Click the "Show outer dialog" button.
  2. Tab navigation is working normally within the outer dialog.
  3. Click the "Show inner dialog" button (brings up the nested Dialog with closable={false}).
  4. Tab navigation is not working in the inner dialog. Instead, tab is navigating the outer dialog.
  5. Click the "Hide inner dialog" button.
  6. Click the "Show inner dialog 2" button (brings up the nested Dialog without closable={false}).
  7. Tab navigation is working in inner dialog 2.

Expected behavior

Tab navigation should work on nested Dialog components where the prop closable={false} has been passed.

@Vampiro Vampiro added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Sep 7, 2022
@melloware melloware changed the title Component: Dialog Dialog: Focus trap issue with multiple dialogs Sep 7, 2022
melloware added a commit to melloware/primereact that referenced this issue Sep 7, 2022
@melloware melloware added Type: Bug Issue contains a defect related to a specific component. and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Sep 7, 2022
@melloware melloware self-assigned this Sep 7, 2022
@melloware melloware added this to the 8.6.0 milestone Sep 7, 2022
@melloware
Copy link
Member

Great test case! Got to the bottom of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants