Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/yummy-dolls-tell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"bits-ui": patch
---

fix(Tooltip): expose `strategy` prop
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
avoidCollisions = true,
arrowPadding = 0,
sticky = "partial",
strategy,
hideWhenDetached = false,
collisionPadding = 0,
onInteractOutside = noop,
Expand Down Expand Up @@ -48,6 +49,7 @@
sticky,
hideWhenDetached,
collisionPadding,
strategy,
});

const mergedProps = $derived(mergeProps(restProps, floatingProps, contentState.props));
Expand Down
17 changes: 1 addition & 16 deletions packages/bits-ui/src/lib/bits/tooltip/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,22 +121,7 @@ export type TooltipRootPropsWithoutHTML = WithChildren<{
export type TooltipRootProps = TooltipRootPropsWithoutHTML;

export type TooltipContentPropsWithoutHTML = WithChildNoChildrenSnippetProps<
Pick<
FloatingLayerContentProps,
| "side"
| "sideOffset"
| "align"
| "alignOffset"
| "avoidCollisions"
| "collisionBoundary"
| "collisionPadding"
| "arrowPadding"
| "sticky"
| "hideWhenDetached"
| "updatePositionStrategy"
| "dir"
| "customAnchor"
> &
Omit<FloatingLayerContentProps, "content" | "preventScroll"> &

Copilot AI Sep 19, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switching from a targeted Pick to a broad Omit exposes almost all FloatingLayerContentProps, not just strategy. This widens the public API surface for TooltipContent beyond the stated goal and risks conflicts with DismissibleLayerProps where keys overlap. Recommend reverting to Pick and explicitly adding 'strategy' to the allowlist to avoid unintended prop exposure.

Suggested change
Omit<FloatingLayerContentProps, "content" | "preventScroll"> &
Pick<FloatingLayerContentProps, "strategy"> &

Copilot uses AI. Check for mistakes.
Omit<DismissibleLayerProps, "onInteractOutsideStart"> &
EscapeLayerProps & {
/**
Expand Down