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

Disclosure component hydration missmatch #40

Closed
gkkirilov opened this issue Jan 27, 2024 · 2 comments
Closed

Disclosure component hydration missmatch #40

gkkirilov opened this issue Jan 27, 2024 · 2 comments

Comments

@gkkirilov
Copy link

gkkirilov commented Jan 27, 2024

image
Wrapping it in ClientOnly fixes it but will be better if the generated id matches and the component is rendered server side.


<Disclosure v-slot="{ open }">
    <DisclosureButton
      class="row text-center w-full flex items-center m-0 py-2"
    >
    Button
      <div class="col-md-1 justify-end flex">
        <ChevronUpIcon
          :class="!open ? 'rotate-180 transform' : ''"
          class="h-7 w-7 text-sky-800 self-center flex"
        />
      </div>
    </DisclosureButton>
      <DisclosurePanel
        class="text-gray-500 py-2 text-center"
      >
      Expanded content
      </DisclosurePanel>
  </Disclosure>
  
@P4sca1
Copy link
Owner

P4sca1 commented Jan 27, 2024

This is an upstream issue. Please see tailwindlabs/headlessui#2913.

@P4sca1 P4sca1 closed this as completed Jan 27, 2024
@vanling
Copy link

vanling commented Feb 4, 2024

@P4sca1 tailwindlabs/headlessui#2913 (comment) could this fix by @reinink work?

<!-- app.vue -->

<template>
  <Switch>
    <!-- .... -->
  </Switch>
</template>

<script setup>
import { Switch, provideUseId } from '@headlessui/vue'

provideUseId(() => useId())
</script>

edit: sorry, nevermind., just now saw your comment there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants