Skip to content

ConfirmPopup issue with focusTrap #19104

@Kwaadpepper

Description

@Kwaadpepper

Describe the bug

Cannot focus the confirm modal with TAB, when combining with focustrap.

Pull Request Link

No response

Reason for not contributing a PR

  • Lack of time
  • Unsure how to implement the fix/feature
  • Difficulty understanding the codebase
  • Other

Other Reason

No response

Reproducer

https://stackblitz.com/edit/efphaqph?file=src%2Fapp%2Fconfirm-popup-basic-demo.html

Environment

Using Firefox Developper version latest, tried with Chrome, Chromium

Angular version

21

PrimeNG version

v20

Node version

No response

Browser(s)

No response

Steps to reproduce the behavior

  1. Open the stack blitz
  2. Click on Toggle Focus trap so it is enabled
  3. Use TAB to navigate on Save button and press space
  4. Use TAB to navigate on modal -> you cant
  5. Now disable focus trap
  6. Use MAJ+TAB to navigate on Save button and press space
  7. Use TAB to navigate into the modal -> you can and will be trapped in the modal

Expected behavior

I expected the modal to be injected nearby (just after) the target, so it would behave as normal and I could navigate into the modal while staying in my Focus trap jail.

Metadata

Metadata

Labels

Status: Pending ReviewIssue or pull request is being reviewed by Core Team

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions