-
-
Notifications
You must be signed in to change notification settings - Fork 170
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When using the dialog component and you only got the close button, you can lose the focus trapping which makes you lose the ability to close the dialog using escape. It works fine with 2 buttons and 0 buttons. I tried looking at the code, and I suspect it is the following line:
bits-ui/packages/bits-ui/src/lib/bits/utilities/focus-scope/focus-scope.svelte.ts
Line 161 in 798d695
| if (tabbables.length < 2) return; |
Reproduction
https://stackblitz.com/edit/nrnpy3gb?file=src%2Froutes%2F%2Bpage.svelte
Logs
System Info
System:
OS: Linux 6.6 Ubuntu 24.04.3 LTS 24.04.3 LTS (Noble Numbat)
CPU: (32) x64 AMD Ryzen 9 9950X3D 16-Core Processor
Memory: 25.10 GB / 30.17 GB
Container: Yes
Shell: 5.2.21 - /bin/bash
Binaries:
Node: 24.11.0 - /home/arkuna/.nvm/versions/node/v24.11.0/bin/node
npm: 11.6.1 - /home/arkuna/.nvm/versions/node/v24.11.0/bin/npm
pnpm: 10.20.0 - /home/arkuna/.local/share/pnpm/pnpm
bun: 1.3.3 - /home/arkuna/.bun/bin/bun
npmPackages:
@sveltejs/kit: ^2.48.5 => 2.49.0
bits-ui: ^2.14.4 => 2.14.4
svelte: ^5.43.8 => 5.43.14Severity
annoyance
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working