diff --git a/packages/@headlessui-react/CHANGELOG.md b/packages/@headlessui-react/CHANGELOG.md index 57d566f76f..e6f63f997f 100644 --- a/packages/@headlessui-react/CHANGELOG.md +++ b/packages/@headlessui-react/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Ensure hidden `Tab.Panel` components are hidden from the accessibility tree ([#2708](https://github.com/tailwindlabs/headlessui/pull/2708)) - Add support for `role="alertdialog"` to `` component ([#2709](https://github.com/tailwindlabs/headlessui/pull/2709)) - Ensure blurring the `Combobox.Input` component closes the `Combobox` ([#2712](https://github.com/tailwindlabs/headlessui/pull/2712)) +- Allow changes to the `className` prop when the `` component is currently not transitioning ([#2722](https://github.com/tailwindlabs/headlessui/pull/2722)) ### Added diff --git a/packages/@headlessui-react/src/components/transitions/transition.tsx b/packages/@headlessui-react/src/components/transitions/transition.tsx index 0adaf5eea2..3dfdf1cb2a 100644 --- a/packages/@headlessui-react/src/components/transitions/transition.tsx +++ b/packages/@headlessui-react/src/components/transitions/transition.tsx @@ -403,15 +403,18 @@ function TransitionChildFn { + isTransitioning.current = true nesting.onStart(container, direction, beforeEvent) }), onStop: useLatestValue((direction) => { + isTransitioning.current = false nesting.onStop(container, direction, afterEvent) if (direction === 'leave' && !hasChildren(nesting)) { @@ -432,7 +435,11 @@ function TransitionChildFn