Skip to content

Commit

Permalink
[useAnchorPositioning] Ensure keepMounted is a private param
Browse files Browse the repository at this point in the history
  • Loading branch information
atomiks committed Feb 4, 2025
1 parent f323fc6 commit 6d92896
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 6 deletions.
4 changes: 4 additions & 0 deletions packages/react/src/menu/positioner/MenuPositioner.spec.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { Menu } from '@base-ui-components/react';

// @ts-expect-error - `keepMounted` should not be available
<Menu.Positioner keepMounted />;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { Popover } from '@base-ui-components/react';

// @ts-expect-error - `keepMounted` should not be available
<Popover.Positioner keepMounted />;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { PreviewCard } from '@base-ui-components/react';

// @ts-expect-error - `keepMounted` should not be available
<PreviewCard.Positioner keepMounted />;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { Select } from '@base-ui-components/react';

// @ts-expect-error - `keepMounted` should not be available
<Select.Positioner keepMounted />;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { Tooltip } from '@base-ui-components/react';

// @ts-expect-error - `keepMounted` should not be available
<Tooltip.Positioner keepMounted />;
8 changes: 2 additions & 6 deletions packages/react/src/utils/useAnchorPositioning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ export function useAnchorPositioning(
collisionPadding = 5,
sticky = false,
arrowPadding = 5,
keepMounted = false,
// Private parameters
keepMounted = false,
floatingRootContext,
mounted,
trackAnchor = true,
Expand Down Expand Up @@ -422,14 +422,10 @@ export namespace useAnchorPositioning {
* @default true
*/
trackAnchor?: boolean;
/**
* Whether to keep the popup mounted in the DOM while it's hidden.
* @default false
*/
keepMounted?: boolean;
}

export interface Parameters extends SharedParameters {
keepMounted?: boolean;
trackCursorAxis?: 'none' | 'x' | 'y' | 'both';
floatingRootContext?: FloatingRootContext;
mounted: boolean;
Expand Down

0 comments on commit 6d92896

Please sign in to comment.