Skip to content

Commit

Permalink
fix: floating ui options (#278)
Browse files Browse the repository at this point in the history
Co-authored-by: Hunter Johnston <johnstonhuntera@gmail.com>
  • Loading branch information
waynetee and huntabyte authored Jan 19, 2024
1 parent f0d80f6 commit ef74ed8
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/calm-masks-camp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"bits-ui": patch
---

fix: expose missing Floating UI content props
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
export let avoidCollisions: $$Props["avoidCollisions"] = true;
export let collisionBoundary: $$Props["collisionBoundary"] = undefined;
export let fitViewport: $$Props["fitViewport"] = false;
export let strategy: $$Props["strategy"] = "absolute";
export let overlap: $$Props["overlap"] = false;
export let el: $$Props["el"] = undefined;
const {
Expand All @@ -47,7 +49,9 @@
collisionPadding,
avoidCollisions,
collisionBoundary,
fitViewport
fitViewport,
strategy,
overlap
});
</script>

Expand Down
9 changes: 7 additions & 2 deletions src/lib/bits/floating/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ export function updatePositioning(store: Writable<FloatingConfig>, props: Floati
sameWidth: false,
avoidCollisions: true,
collisionPadding: 8,
fitViewport: false
fitViewport: false,
strategy: "absolute",
overlap: false
} satisfies FloatingProps;

const withDefaults = { ...defaultPositioningProps, ...props } satisfies FloatingProps;
Expand All @@ -37,7 +39,10 @@ export function updatePositioning(store: Writable<FloatingConfig>, props: Floati
sameWidth: withDefaults.sameWidth,
flip: withDefaults.avoidCollisions,
overflowPadding: withDefaults.collisionPadding,
boundary: withDefaults.collisionBoundary
boundary: withDefaults.collisionBoundary,
fitViewport: withDefaults.fitViewport,
strategy: withDefaults.strategy,
overlap: withDefaults.overlap
};
});
}
Expand Down
6 changes: 5 additions & 1 deletion src/lib/bits/popover/components/popover-content.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
export let collisionBoundary: $$Props["collisionBoundary"] = undefined;
export let sameWidth: $$Props["sameWidth"] = false;
export let fitViewport: $$Props["fitViewport"] = false;
export let strategy: $$Props["strategy"] = "absolute";
export let overlap: $$Props["overlap"] = false;
export let el: $$Props["el"] = undefined;
const {
Expand All @@ -53,7 +55,9 @@
avoidCollisions,
collisionBoundary,
sameWidth,
fitViewport
fitViewport,
strategy,
overlap
});
</script>

Expand Down
6 changes: 5 additions & 1 deletion src/lib/bits/select/components/select-content.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
export let collisionBoundary: $$Props["collisionBoundary"] = undefined;
export let sameWidth: $$Props["sameWidth"] = true;
export let fitViewport: $$Props["fitViewport"] = false;
export let strategy: $$Props["strategy"] = "absolute";
export let overlap: $$Props["overlap"] = false;
export let el: $$Props["el"] = undefined;
const {
Expand Down Expand Up @@ -57,7 +59,9 @@
avoidCollisions,
collisionBoundary,
sameWidth,
fitViewport
fitViewport,
strategy,
overlap
});
</script>

Expand Down

0 comments on commit ef74ed8

Please sign in to comment.