From 7d5f6747f81bedd271577d33467ba4a2320a8d22 Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Mon, 8 Jul 2024 14:08:28 +0200 Subject: [PATCH 1/2] do not change visibility of `Transition` component 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 --- .../src/components/transition/transition.tsx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packages/@headlessui-react/src/components/transition/transition.tsx b/packages/@headlessui-react/src/components/transition/transition.tsx index a911b4919f..1167e6ef7b 100644 --- a/packages/@headlessui-react/src/components/transition/transition.tsx +++ b/packages/@headlessui-react/src/components/transition/transition.tsx @@ -17,7 +17,6 @@ import { useEvent } from '../../hooks/use-event' import { useIsMounted } from '../../hooks/use-is-mounted' import { useIsoMorphicEffect } from '../../hooks/use-iso-morphic-effect' import { useLatestValue } from '../../hooks/use-latest-value' -import { useOnDisappear } from '../../hooks/use-on-disappear' import { useServerHandoffComplete } from '../../hooks/use-server-handoff-complete' import { useSyncRefs } from '../../hooks/use-sync-refs' import { transitionDataAttributes, useTransition } from '../../hooks/use-transition' @@ -549,9 +548,6 @@ function TransitionRootFn