Skip to content

Commit

Permalink
fix: avoidCollisions (#984)
Browse files Browse the repository at this point in the history
  • Loading branch information
huntabyte authored Dec 8, 2024
1 parent a0da6af commit 497e5e1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/heavy-boats-drive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"bits-ui": patch
---

fix: `avoidCollisions` in Floating UI components
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,14 @@ class FloatingContentState {
mainAxis: this.#sideOffset.current + this.#arrowHeight,
alignmentAxis: this.#alignOffset.current,
}),
this.#avoidCollisions &&
this.#avoidCollisions.current &&
shift({
mainAxis: true,
crossAxis: false,
limiter: this.#sticky.current === "partial" ? limitShift() : undefined,
...this.detectOverflowOptions,
}),
this.#avoidCollisions && flip({ ...this.detectOverflowOptions }),
this.#avoidCollisions.current && flip({ ...this.detectOverflowOptions }),
size({
...this.detectOverflowOptions,
apply: ({ rects, availableWidth, availableHeight }) => {
Expand Down

0 comments on commit 497e5e1

Please sign in to comment.