Skip to content

Commit

Permalink
Fix prematurely added anchoring styles on ListboxOptions (#3337)
Browse files Browse the repository at this point in the history
* fix prematurely adding anchoring styles on `ListboxOptions`

* update changelog
  • Loading branch information
RobinMalfait authored Jun 27, 2024
1 parent abd86fc commit fbad6a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/@headlessui-react/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- Nothing yet!
### Fixed

- Fix prematurely added anchoring styles on `ListboxOptions` ([#3337](https://github.com/tailwindlabs/headlessui/pull/3337))

## [2.1.1] - 2024-06-26

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -983,6 +983,7 @@ function OptionsFn<TTag extends ElementType = typeof DEFAULT_OPTIONS_TAG>(
}, [anchor, data.options])

let anchorOptions = (() => {
if (anchor == null) return undefined
if (selectedOptionIndex === null) return { ...anchor, inner: undefined }

let elements = Array.from(data.listRef.current.values())
Expand Down

0 comments on commit fbad6a9

Please sign in to comment.