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

next : Error when disabled is set on AlertDialog.Portal and dialog is open on load #1077

Closed
SteelAlloy opened this issue Jan 30, 2025 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@SteelAlloy
Copy link

Describe the bug

I tried to render the Dialog component in an open state (on load) while disabling the Portal.

My original intention was to make a progressive navigation that would work even without javascript, that said I don't know if it's feasible.

<AlertDialog.Root open={true}>
	<AlertDialog.Portal disabled>
		<AlertDialog.Overlay/>
		<AlertDialog.Content
			<!-- ... -->
		</AlertDialog.Content>
	</AlertDialog.Portal>
</AlertDialog.Root>

Reproduction

https://stackblitz.com/edit/github-mcd4pjzy?file=src%2Froutes%2F%2Bpage.svelte

Logs

TypeError: Cannot read properties of undefined (reading 'map')
    at useBodyScrollLock (/node_modules/.pnpm/bits-ui@1.0.0-next.80_svelte@5.19.4/node_modules/bits-ui/dist/internal/use-body-scroll-lock.svelte.js:85:16)
    at Scroll_lock (/node_modules/.pnpm/bits-ui@1.0.0-next.80_svelte@5.19.4/node_modules/bits-ui/dist/bits/utilities/scroll-lock/scroll-lock.svelte:7:19)
    at children (/node_modules/.pnpm/bits-ui@1.0.0-next.80_svelte@5.19.4/node_modules/bits-ui/dist/bits/alert-dialog/components/alert-dialog-content.svelte:98:49)
    at Text_selection_layer (/node_modules/.pnpm/bits-ui@1.0.0-next.80_svelte@5.19.4/node_modules/bits-ui/dist/bits/utilities/text-selection-layer/text-selection-layer.svelte:25:18)
    at children (/node_modules/.pnpm/bits-ui@1.0.0-next.80_svelte@5.19.4/node_modules/bits-ui/dist/bits/alert-dialog/components/alert-dialog-content.svelte:72:45)
    at Dismissible_layer (/node_modules/.pnpm/bits-ui@1.0.0-next.80_svelte@5.19.4/node_modules/bits-ui/dist/bits/utilities/dismissible-layer/dismissible-layer.svelte:27:18)
    at children (/node_modules/.pnpm/bits-ui@1.0.0-next.80_svelte@5.19.4/node_modules/bits-ui/dist/bits/alert-dialog/components/alert-dialog-content.svelte:61:42)
    at Escape_layer (/node_modules/.pnpm/bits-ui@1.0.0-next.80_svelte@5.19.4/node_modules/bits-ui/dist/bits/utilities/escape-layer/escape-layer.svelte:21:18)
    at focusScope (/node_modules/.pnpm/bits-ui@1.0.0-next.80_svelte@5.19.4/node_modules/bits-ui/dist/bits/alert-dialog/components/alert-dialog-content.svelte:51:39)
    at Focus_scope (/node_modules/.pnpm/bits-ui@1.0.0-next.80_svelte@5.19.4/node_modules/bits-ui/dist/bits/utilities/focus-scope/focus

System Info

System:
    OS: Linux 5.15 Ubuntu 24.04.1 LTS 24.04.1 LTS (Noble Numbat)
    CPU: (32) x64 13th Gen Intel(R) Core(TM) i9-13900F
    Memory: 25.53 GB / 31.25 GB
    Container: Yes
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.7.0 - ~/.nvm/versions/node/v22.7.0/bin/node
    npm: 10.8.2 - ~/.nvm/versions/node/v22.7.0/bin/npm
    pnpm: 9.15.4 - ~/.nvm/versions/node/v22.7.0/bin/pnpm
  npmPackages:
    @sveltejs/kit: ^2.16.0 => 2.16.1 
    bits-ui: 1.0.0-next.80 => 1.0.0-next.80 
    svelte: ^5.19.4 => 5.19.4

Severity

blocking an upgrade

@huntabyte huntabyte added the bug Something isn't working label Jan 30, 2025
@huntabyte huntabyte added this to the 1.0 milestone Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants