Skip to content

Commit

Permalink
only render the Dialog on the client
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinMalfait committed Jun 9, 2022
1 parent f2a813e commit 10ebf51
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/@headlessui-vue/src/components/dialog/dialog.ts
Expand Up @@ -78,10 +78,17 @@ export let Dialog = defineComponent({
},
emits: { close: (_close: boolean) => true },
setup(props, { emit, attrs, slots, expose }) {
let ready = ref(false)
onMounted(() => {
ready.value = true
})

let nestedDialogCount = ref(0)

let usesOpenClosedState = useOpenClosed()
let open = computed(() => {
if (ready.value === false) return false

if (props.open === Missing && usesOpenClosedState !== null) {
// Update the `open` prop based on the open closed state
return match(usesOpenClosedState.value, {
Expand Down

0 comments on commit 10ebf51

Please sign in to comment.