Skip to content

Commit

Permalink
Try padding the vertical toolbars shift range
Browse files Browse the repository at this point in the history
  • Loading branch information
stokesman committed Oct 5, 2024
1 parent eddd3f8 commit 72d0498
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default function ZoomOutPopover( { clientId, __unstableContentRef } ) {
...popoverProps,
placement: 'left-start',
flip: false,
shift: true,
shift: { padding: { top: 48, bottom: 48 } },
};

return (
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/popover/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ const UnforwardedPopover = (
shiftMiddleware( {
crossAxis: true,
limiter: limitShift(),
padding: 1, // Necessary to avoid flickering at the edge of the viewport.
padding: typeof shift === 'boolean' ? 1 : shift.padding ?? 1, // Necessary to avoid flickering at the edge of the viewport.
} ),
arrow( { element: arrowRef } ),
];
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/popover/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import type { ReactNode, MutableRefObject, SyntheticEvent } from 'react';
import type { Placement } from '@floating-ui/react-dom';
import type { Placement, ShiftOptions } from '@floating-ui/react-dom';

type PositionYAxis = 'top' | 'middle' | 'bottom';
type PositionXAxis = 'left' | 'center' | 'right';
Expand Down Expand Up @@ -139,7 +139,7 @@ export type PopoverProps = {
*
* @default false
*/
shift?: boolean;
shift?: boolean | ShiftOptions;
/**
* Specifies the popover's style.
*
Expand Down

0 comments on commit 72d0498

Please sign in to comment.