Skip to content

Commit 09b1e86

Browse files
committed
merge checks
1 parent f4c11aa commit 09b1e86

File tree

1 file changed

+1
-5
lines changed
  • packages/@headlessui-react/src/components/listbox

1 file changed

+1
-5
lines changed

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -589,17 +589,13 @@ function OptionsFn<TTag extends ElementType = typeof DEFAULT_OPTIONS_TAG>(
589589
// the panel whenever necessary.
590590
let panelEnabled = didButtonMove ? false : visible
591591

592-
// The moment we picked a value in single value mode, the value should be
593-
// frozen immediately.
594-
let hasFrozenValue = useSlice(machine, machine.selectors.hasFrozenValue)
595-
596592
// We should freeze when the listbox is visible but "closed". This means that
597593
// a transition is currently happening and the component is still visible (for
598594
// the transition) but closed from a functionality perspective.
599595
//
600596
// When the `static` prop is used, we should never freeze, because rendering
601597
// is up to the user.
602-
let shouldFreeze = hasFrozenValue && !props.static
598+
let shouldFreeze = useSlice(machine, machine.selectors.hasFrozenValue) && !props.static
603599

604600
// Frozen state, the selected value will only update visually when the user re-opens the <Listbox />
605601
let frozenValue = useFrozenData(shouldFreeze, data.value)

0 commit comments

Comments
 (0)