Open
Description
Describe the bug
When passing popperConfig into an Overlay component, the flip modifiers are not applied.
To Reproduce
Steps to reproduce the behavior:
- Create an Overlay component with a popperConfig that has flip modifiers set
- Observe that those modifiers are not applied
Expected behavior
Expected that the modifiers passed in (ex: behavior) would be applied to the underlying popper instance
Screenshots
If applicable, add screenshots to help explain your problem.
Environment (please complete the following information)
- Operating System: [e.g. macOS]
MacOS - Browser, Version [e.g. Chrome 74]
Chrome 78.0.3904.108 - react-overlays Version [e.g. 2.0.0]
2.1.0
Additional context
I see in Overlay.js that the preventOverflow modifiers are spread onto the popper config. Is this intentional?
const { styles, arrowStyles, ...popper } = usePopper(target, rootElement, {
...popperConfig,
placement: placement || 'bottom',
enableEvents: props.show,
modifiers: {
...modifiers,
preventOverflow: {
padding: containerPadding || 5,
...modifiers.preventOverflow,
},
arrow: {
...modifiers.arrow,
enabled: !!arrowElement,
element: arrowElement,
},
flip: {
enabled: !!flip,
...modifiers.preventOverflow,
},
},
});
Metadata
Metadata
Assignees
Labels
No labels