Skip to content

Commit d8f44e0

Browse files
authored
Fix transition and focus prop combination for PopoverPanel component (#3361)
* trigger effect when ref value changes * update changelog
1 parent 70f88f4 commit d8f44e0

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

packages/@headlessui-react/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
- Ensure `unmount` on `Dialog` works in combination with the `transition` prop on `DialogBackdrop` and `DialogPanel` components ([#3352](https://github.com/tailwindlabs/headlessui/pull/3352))
1414
- Fix crash in `Combobox` component when in `virtual` mode when options are empty ([#3356](https://github.com/tailwindlabs/headlessui/pull/3356))
1515
- Fix hanging tests when using `anchor` prop ([#3357](https://github.com/tailwindlabs/headlessui/pull/3357))
16+
- Fix `transition` and `focus` prop combination for `PopoverPanel` component ([#3361](https://github.com/tailwindlabs/headlessui/pull/3361))
1617

1718
## [2.1.1] - 2024-06-26
1819

packages/@headlessui-react/src/components/popover/popover.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,7 @@ function PanelFn<TTag extends ElementType = typeof DEFAULT_PANEL_TAG>(
930930
if (internalPanelRef.current.contains(activeElement)) return // Already focused within Dialog
931931

932932
focusIn(internalPanelRef.current, Focus.First)
933-
}, [state.__demoMode, focus, internalPanelRef, state.popoverState])
933+
}, [state.__demoMode, focus, internalPanelRef.current, state.popoverState])
934934

935935
let slot = useMemo(() => {
936936
return {

0 commit comments

Comments
 (0)