Skip to content

Commit

Permalink
Add overflow: auto when using the anchor prop (#3138)
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinMalfait authored Apr 25, 2024
1 parent 8c7cbb3 commit 26e1644
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/@headlessui-react/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Ensure anchored components are always rendered in a stacking context ([#3115](https://github.com/tailwindlabs/headlessui/pull/3115))
- Add optional `onClose` callback to `Combobox` component ([#3122](https://github.com/tailwindlabs/headlessui/pull/3122))
- Make sure `data-disabled` is available on virtualized options in the `Combobox` component ([#3128](https://github.com/tailwindlabs/headlessui/pull/3128))
- Add `overflow: auto` when using the `anchor` prop ([#3138](https://github.com/tailwindlabs/headlessui/pull/3138))

### Changed

Expand Down
1 change: 1 addition & 0 deletions packages/@headlessui-react/src/internal/floating.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ export function FloatingProvider({
sizeMiddleware({
apply({ availableWidth, availableHeight, elements }) {
Object.assign(elements.floating.style, {
overflow: 'auto',
maxWidth: `${availableWidth - padding}px`,
maxHeight: `${availableHeight - padding}px`,
})
Expand Down

0 comments on commit 26e1644

Please sign in to comment.