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

Improve dialog and server handoff #477

Merged
merged 4 commits into from
May 4, 2021
Merged

Improve dialog and server handoff #477

merged 4 commits into from
May 4, 2021

Conversation

RobinMalfait
Copy link
Member

@RobinMalfait RobinMalfait commented May 4, 2021

  • delay initialization of Dialog
  • add hook to deal with server handoff
  • use server handoff complete hook

Fixes: #470
Fixes: #450

We were using a useLayoutEffect, now let's use a useEffect instead. It
still moves focus to the correct element, but that process is now a bit
delayed. This means that users will less-likely be urged to "hack"
around the issue by using fake focusable elements which will result in
worse accessibility.
This will allow us to delay certain features. For example we can delay
the focus trapping until it is fully hydrated. We can also delay
rendering the Portal to ensure hydration works correctly.
@vercel
Copy link

vercel bot commented May 4, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

headlessui-react – ./packages/@headlessui-react

🔍 Inspect: https://vercel.com/tailwindlabs/headlessui-react/79Jv75LjZbQdnsgH65MAMWos94WS
✅ Preview: https://headlessui-react-git-improve-dialog-tailwindlabs.vercel.app

headlessui-vue – ./packages/@headlessui-vue

🔍 Inspect: https://vercel.com/tailwindlabs/headlessui-vue/8dHAVMZmusFBqs1UnEkFVXLbHLvr
✅ Preview: https://headlessui-vue-git-improve-dialog-tailwindlabs.vercel.app

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 this pull request may close these issues.

1 participant