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

SSR Accessibility issues with Disclosure component on Nuxt3/Vue #2624

Closed
ffoerster opened this issue Jul 28, 2023 · 2 comments · Fixed by #2645
Closed

SSR Accessibility issues with Disclosure component on Nuxt3/Vue #2624

ffoerster opened this issue Jul 28, 2023 · 2 comments · Fixed by #2645
Assignees

Comments

@ffoerster
Copy link

ffoerster commented Jul 28, 2023

What package within Headless UI are you using?
@headlessui/vue

What version of that package are you using?
v1.7.15

What browser are you using?
Arc / N/A

Reproduction URL
https://stackblitz.com/edit/nuxt-starter-evrrcf?file=app.vue

Describe your issue
If a <Disclosure /> component is used with the default-open prop and is rendered on the server, the initial markup has malformed aria markup (that will trigger lighthouse accessibility checks)

Screenshot 2023-07-28 at 09 48 32

After opening/closing the element, correct markup is returned.
Screenshot 2023-07-28 at 09 48 55

Not sure, if this is a headlessui bug or something related to nuxt/vue ssr though.

@RobinMalfait
Copy link
Collaborator

Hey, thank you for this bug report! 🙏

This was a fun one! We made it work in a non-Nuxt application but then ran into funny mismatch issues in a Nuxt application. For example, logging/looking at the actual data we saw the correct values, but in the DOM the incorrect values were used.

We figured out a way by restructuring some internal code to make it work with SSR and hydration.

This should be fixed by #2645, and will be available in the next release.

You can already try it using:

  • npm install @headlessui/vue@insiders.

@husayt
Copy link

husayt commented Dec 27, 2023

This alone is a fix deserving for the release to happen

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

Successfully merging a pull request may close this issue.

3 participants