Skip to content

Commit

Permalink
Issue 1070 Fix popper positioning when using persist in dropdown menus (
Browse files Browse the repository at this point in the history
  • Loading branch information
humphreyja committed Sep 28, 2023
1 parent b932582 commit 777e5eb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/DropdownMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,20 @@ class DropdownMenu extends React.Component {
},
];

const persistStyles = {};
if (persist) {
persistStyles.display = 'block';
persistStyles.visibility = this.context.isOpen ? 'visible' : 'hidden';
}

const popper = (
<Popper
placement={poperPlacement}
modifiers={poperModifiers}
strategy={strategy}
>
{({ ref, style, placement, update }) => {
let combinedStyle = { ...this.props.style, ...style };
let combinedStyle = { ...this.props.style, ...persistStyles, ...style };

const handleRef = (tagRef) => {
// Send the ref to `react-popper`
Expand Down

0 comments on commit 777e5eb

Please sign in to comment.