-
Notifications
You must be signed in to change notification settings - Fork 222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flip Modifiers Not Applied #749
Comments
@jquense should explicitly-specified |
I've been running into something similar, where the react-overlays/src/DropdownMenu.js Lines 42 to 65 in 26c1f4f
Although this docstring falsely claims that all provided options are passed on: react-overlays/src/DropdownMenu.js Lines 153 to 156 in 26c1f4f
|
which options aren't being passed? |
@jquense Anything outside of the |
Happy to take a PR fixing this if you want to send one over |
@jquense I'm afraid I'm lacking a bit of JS testing expertise (naively getting the computed style of the menu and checking for the value of the diff --git a/src/DropdownMenu.js b/src/DropdownMenu.js
index ae98e2e..8c2dfbe 100644
--- a/src/DropdownMenu.js
+++ b/src/DropdownMenu.js
@@ -42,6 +42,7 @@ export function useDropdownMenu(options = {}) {
const modifiers = toModifierMap(popperConfig.modifiers);
const popper = usePopper(toggleElement, menuElement, {
+ ...popperConfig,
placement,
enabled: !!(shouldUsePopper && show),
modifiers: { For now I switched back to Reactstrap (where this behavior can be made to work), but maybe someone else feels qualified to also add working tests here. |
that change looks fine, i don't think you need to add any tests for it |
@jquense Ok great, I filed #779, but didn't mark it as fixing this specific issue here, as the flip modifier still gets overridden after the spread of the user-provided options. Or maybe the spreading order should be inverted, so that for both modifiers and the rest of the popper config, the user-provided values always win? But for now I only provided the obvious (least risky) fix in the PR. |
Describe the bug
When passing popperConfig into an Overlay component, the flip modifiers are not applied.
To Reproduce
Steps to reproduce the behavior:
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)
MacOS
Chrome 78.0.3904.108
2.1.0
Additional context
I see in Overlay.js that the preventOverflow modifiers are spread onto the popper config. Is this intentional?
The text was updated successfully, but these errors were encountered: