Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit 162be80

Browse files
committed
flipVariationsByContent should be added by default to Popper to improve positioning algorithm
1 parent ace6382 commit 162be80

2 files changed

Lines changed: 1 addition & 2 deletions

File tree

packages/react/src/components/Menu/MenuItem.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@ class MenuItem extends AutoControlledComponent<WithAsProp<MenuItemProps>, MenuIt
247247
align={vertical ? 'top' : 'start'}
248248
position={vertical ? 'after' : 'below'}
249249
targetRef={this.itemRef}
250-
modifiers={{ flip: { flipVariationsByContent: true } }}
251250
>
252251
{Menu.create(menu, {
253252
defaultProps: {

packages/react/src/lib/positioner/Popper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ const Popper: React.FunctionComponent<PopperProps> = props => {
8989

9090
const modifiers: PopperJS.Modifiers = _.merge(
9191
{ preventOverflow: { padding: 0 } },
92-
{ flip: { padding: 0 } },
92+
{ flip: { padding: 0, flipVariationsByContent: true } },
9393
/**
9494
* When the popper box is placed in the context of a scrollable element, we need to set
9595
* preventOverflow.escapeWithReference to true and flip.boundariesElement to 'scrollParent' (default is 'viewport')

0 commit comments

Comments
 (0)