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

UCarousel with Arrows enabled causes Hydration Attribute Mismatch #2254

Open
LynxTR opened this issue Sep 25, 2024 · 2 comments
Open

UCarousel with Arrows enabled causes Hydration Attribute Mismatch #2254

LynxTR opened this issue Sep 25, 2024 · 2 comments
Labels
bug Something isn't working triage

Comments

@LynxTR
Copy link

LynxTR commented Sep 25, 2024

Environment

Version

v2.18.4

Reproduction

https://stackblitz.com/edit/nuxt-ui-n3dolc

Description

Late attribute render of disabled="true" causes hydration mismatch

Additional context

Screenshot from 2024-09-26 01-36-36

Logs

No response

@LynxTR LynxTR added bug Something isn't working triage labels Sep 25, 2024
@tahirmahmudzade
Copy link

Environment

* Operating System: Linux

* Node Version:     v18.18.0

* Nuxt Version:     3.13.0

* CLI Version:      3.13.1

* Nitro Version:    2.9.7

* Package Manager:  [email protected]

* Builder:          -

* User Config:      compatibilityDate, experimental, css, modules, devtools, sanctum, formkit, colorMode, htmlValidator, app

* Runtime Modules:  @formkit/auto-animate/[email protected], @formkit/[email protected], @nuxtjs/[email protected], @nuxtjs/[email protected], @nuxt/[email protected], @unocss/[email protected], @vueuse/[email protected], [email protected]

* Build Modules:    -

Version

v2.18.4

Reproduction

https://stackblitz.com/edit/nuxt-ui-n3dolc

Description

Late attribute render of disabled="true" causes hydration mismatch

Additional context

Screenshot from 2024-09-26 01-36-36

Logs

No response

hey i am facing the same issue, did you find a solution ?

@LynxTR
Copy link
Author

LynxTR commented Oct 17, 2024

@tahirmahmudzade Sorry for late response, i used the named slots to render buttons client only:

  <UCarousel :items="items" :ui="{ item: 'basis-1/3' }" arrows>
 <template #prev="{ onClick, disabled }">
      <ClientOnly>
        <UButton
          :disabled="disabled"
          @click="onClick"
          :ui="{
            rounded: 'rounded-full',
          }"
          color="gray"
          icon="i-ph:arrow-left-duotone"
          variant="solid"
          aria-label="Anterior"
          class="-start-12 absolute top-1/2 -translate-y-1/2"
        ></UButton>
      </ClientOnly>
    </template>
    <template #next="{ onClick, disabled }">
      <ClientOnly>
        <UButton
          :disabled="disabled"
          @click="onClick"
          :ui="{
            rounded: 'rounded-full',
          }"
          color="gray"
          icon="i-ph:arrow-right-duotone"
          variant="solid"
          aria-label="Siguiente"
          class="-end-12 absolute top-1/2 -translate-y-1/2"
        ></UButton>
      </ClientOnly>
    </template>

    <!-- here the items -->
 </UCarousel> 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

2 participants