tailwindlabs / headlessui

Completely unstyled, fully accessible UI components, designed to integrate beautifully with Tailwind CSS.
https://headlessui.com
MIT License
25.81k stars 1.07k forks source link

Internal refactor: use `flushSync()` instead of `d.nextFrame()` #3263

Closed RobinMalfait closed 4 months ago

RobinMalfait commented 4 months ago

This PR improves some internals by using flushSync() instead of our d.nextFrame() calls.

The benefit is that flushSync() guarantees that the DOM is updated after this call finishes. This means that we don't have to schedule a callback in the future and hope that the DOM is updated by that time.

vercel[bot] commented 4 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
headlessui-react ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 2, 2024 6:39pm
headlessui-vue ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 2, 2024 6:39pm