Skip to content

Commit

Permalink
fix(DropdownMenu): Prevent manual styles from overriding popper styles (
Browse files Browse the repository at this point in the history
  • Loading branch information
kyletsang committed Oct 29, 2020
1 parent 9ee5b1f commit dc2401b
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions src/DropdownMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,21 @@ class DropdownMenu extends React.Component {
modifiers={poperModifiers}
positionFixed={popperPositionFixed}
>
{({ ref, style, placement }) => (
<Tag
tabIndex="-1"
role="menu"
ref={ref}
style={style}
{...attrs}
aria-hidden={!this.context.isOpen}
className={classes}
x-placement={placement}
/>
)}
{({ ref, style, placement }) => {
let combinedStyle = { ...this.props.style, ...style };
return (
<Tag
tabIndex="-1"
role="menu"
ref={ref}
{...attrs}
style={combinedStyle}
aria-hidden={!this.context.isOpen}
className={classes}
x-placement={placement}
/>
);
}}
</Popper>
);
}
Expand Down

0 comments on commit dc2401b

Please sign in to comment.