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

Ensure `Transition` component state doesn't change when it becomes hidden #3372

Closed RobinMalfait closed 2 months ago

RobinMalfait commented 2 months ago

This was originally introduced in https://github.com/tailwindlabs/headlessui/pull/1519 to fix an issue where some enter transitions where broken: https://github.com/tailwindlabs/headlessui/issues/1503

However, since we refactored the Transition component to make use of the useTransition hook, I can't seem to reproduce this issue anymore.

In fact, removing this code fixes an issue.

The bigger issue here is that when the component becomes hidden, that we always set the state to hidden as well. But if it becomes visible again, we don't show it again.

Right now, since I couldn't reproduce any of the other issue, I opted to just removing the code entirely. But if we ever need it again, we probably have to make sure that it becomes visible in the other scenario as well.

Fixes: #3328

vercel[bot] commented 2 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 Jul 8, 2024 0:24am
headlessui-vue ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2024 0:24am