Skip to content

Commit

Permalink
Border Controls/Color Palette: Ensure popovers remain within small vi…
Browse files Browse the repository at this point in the history
…ewports (#41930)
  • Loading branch information
aaronrobertshaw authored Jun 29, 2022
1 parent 0a5bbb4 commit 69f64df
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

- Wrapped `ColorIndicator` in a `forwardRef` call ([#41587](https://github.com/WordPress/gutenberg/pull/41587)).
- `BorderControl`: Improve TypeScript support. ([#41843](https://github.com/WordPress/gutenberg/pull/41843)).
- `DatePicer`: highlight today's date. ([#41647](https://github.com/WordPress/gutenberg/pull/41647/)).
- `DatePicker`: highlight today's date. ([#41647](https://github.com/WordPress/gutenberg/pull/41647/)).
- Allow automatic repositioning of `BorderBoxControl` and `ColorPalette` popovers within smaller viewports ([#41930](https://github.com/WordPress/gutenberg/pull/41930)).

### Internal

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const BorderBoxControlSplitControls = (
placement: popoverPlacement,
offset: popoverOffset,
anchorRef: containerRef,
__unstableShift: true,
}
: undefined;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ const BorderBoxControl = (
placement: popoverPlacement,
offset: popoverOffset,
anchorRef: containerRef,
__unstableShift: true,
}
: undefined;

Expand Down
6 changes: 5 additions & 1 deletion packages/components/src/color-palette/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,11 @@ export function CustomColorPickerDropdown( { isRenderedInSidebar, ...props } ) {
contentClassName="components-color-palette__custom-color-dropdown-content"
popoverProps={
isRenderedInSidebar
? { placement: 'left-start', offset: 20 }
? {
placement: 'left-start',
offset: 20,
__unstableShift: true,
}
: undefined
}
{ ...props }
Expand Down

0 comments on commit 69f64df

Please sign in to comment.