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 does not work properly when <sl-dialog> is in a shadow root #1382

Closed
danNordlogic opened this issue Jun 19, 2023 · 1 comment · Fixed by #1403
Closed
Assignees
Labels
bug Things that aren't working right in the library.

Comments

@danNordlogic
Copy link

danNordlogic commented Jun 19, 2023

Describe the bug

Rendering and opening an inside of a shadow root does not seem to play nice with the focus trap. I can tab out of the dialog into elements underneath it.
Ths problem was already raised here: #709 but it seems it's still not solved (using version 2.4.0).

To Reproduce

Steps to reproduce the behavior:

Create a new Lit project
Add shoelace as a dependency (or via CDN)
Use the example code from the documentation
Open the dialog and press tab. The focus will move to the button underneath.

Demo

Reproduction on CodeSandbox

Browser / OS

  • OS: [e.g. Mac, Windows]
  • Browser: Chrome Version 114.0.5735.111, Edge Version 114.0.1823.51
@danNordlogic danNordlogic added the bug Things that aren't working right in the library. label Jun 19, 2023
@claviska
Copy link
Member

Here's a CodePen, for convenience: https://codepen.io/claviska/pen/bGQeWgY

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Things that aren't working right in the library.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants