Programmatically open Dialog #1620
Unanswered
DamienPace15
asked this question in
Help
Replies: 1 comment 1 reply
-
Hey, @DamienPace15 shouldn't this work?
<script lang="ts">
import * as Dialog from "$lib/components/ui/dialog/index.js";
let { open } : { open: boolean } = $props();
</script>
<Dialog.Root bind:open>
<Dialog.Content>
<Dialog.Header>
<Dialog.Title>Are you sure absolutely sure?</Dialog.Title>
<Dialog.Description>
This action cannot be undone. This will permanently delete your account
and remove your data from our servers.
</Dialog.Description>
</Dialog.Header>
</Dialog.Content>
</Dialog.Root>
<script lang="ts">
import Foo from './foo.svelte'
let open = $state(false);
</script>
<Foo {open} /> |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to open a dialog on click.
This is the section where the
NewModal
component is being called.NewModal.svelte
I have also used Dialog.Trigger in the second block and it still doesn't open.
Whenever I click the
content-card
div it doesn't show the Dialog at all.I was able to follow the instructions and actually have something show up when it wasn't in a component but once I moved it into a new folder it just wont show.
Am I doing this completely wrong?
Have followed the following:
I am new to frontend development so sorry if this is bad
Beta Was this translation helpful? Give feedback.
All reactions