-
-
Notifications
You must be signed in to change notification settings - Fork 79k
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
Popper.js messing up dropdown styles #23378
Comments
These styles are the ones needed to actually position the dropdown. Without them the dropdown would not be positioned. |
Yep but that's possible to disable Popper.js style we did it when Dropdown are in a navbar so why not add a feature to allow folks to do that |
But then what's the point to use a dropdown? |
Yep I agree they won't take any advantage of Popper.js |
Perhaps @myorangeca can elaborate on the custom animations being applied so we can see what properties conflict? I definitely understand the desire to customize animations for positioned elements. |
It's probably because of the Doing so the outer most wrapper is used for the position and the inner one for the animations |
I have customized the dropdown to do the following animation below. I had to use !important style to override popper.js styles (clearly not the best solution).
Where I understand that popper inserts these classes dynamically to position the dropdown, but it causes problems if the dropdown is inside some container or in a nav bar with 'boxed layout view' I think popper.js should have an option to check elements with certain data attributes (ie data-popper-static) to ignore hardcoded styles for that particular element. |
Would like to add, if I have any custom scroll plugins inside any dropdowns (ie. slimscroll.js), popper's custom style messes up the plugin from being rendered (translate3d bug maybe). We will be needing some form of control to disable the plugins ability to add custom styles for some elements. |
@myorangeca may you open an issue on the popper.js repo about the scroll plugins? I use a scroll plugin in the demo website popper.js.org and works just fine |
@FezVrasta I might just do that. But don't you think a css solution would be more prefered over a JS solution. And the option to disable the popper's custom style might be needed in some cases? |
I'm a yes on both accounts, for what it's worth. |
You can just turn off the transform placement on Popper to make it only use top/left for positioning instead. Then you can use transform for any animations/transitions as you wish. Popper.Defaults.modifiers.computeStyle.gpuAcceleration = false; |
@klaslundberg thanks for that! I still think there should be an option via data-tooltip to disable this; |
This hurt me for several hours today as well, trying to figure out why all my dropdown animations suddenly started going crazy. A lot of people are going to want to animate their dropdowns... |
my dropdown list was flying all over the document), the problem solved only by turning off the computeStyle Popper.Defaults.modifiers.computeStyle.enabled = false; |
|
@logolevel's hack works! Thx! |
In Bootstrap >=4.1 there is an 'data-display="static"' attribute that you could add to the toggle element. That way Popper wont mess with de position of that dropdown specifically. |
Thank you for the breadcrumb @leitocardoso . This does indeed prevent any inlines styles, thank you. Doc - https://getbootstrap.com/docs/4.2/components/dropdowns/#responsive-alignment FWIW, just upgraded to bootstrap 4.2 and was really surprised to find this. This should live in the core SASS bundle, like everything else, not controlled by JS (other than class toggling). |
@leitocardoso thank you very much .. |
This solved my issue. Thanks a lot. |
Dropdown menus (eg.: font-size) had their contents cropped if space was lacking underneath the toolbar. With this the user can scroll down to see the rest of it if needed. More info: twbs/bootstrap#23378
Dropdown menus (eg.: font-size) had their contents cropped if space was lacking underneath the toolbar. With this the user can scroll down to see the rest of it if needed. More info: twbs/bootstrap#23378 closes #69638 Signed-off-by: David Monjoie (dmo) <[email protected]>
Dropdown menus (eg.: font-size) had their contents cropped if space was lacking underneath the toolbar. With this the user can scroll down to see the rest of it if needed. More info: twbs/bootstrap#23378 X-original-commit: d360b75
Dropdown menus (eg.: font-size) had their contents cropped if space was lacking underneath the toolbar. With this the user can scroll down to see the rest of it if needed. More info: twbs/bootstrap#23378 closes #69644 X-original-commit: d360b75 Signed-off-by: David Monjoie (dmo) <[email protected]>
Dropdown menus (eg.: font-size) had their contents cropped if space was lacking underneath the toolbar. With this the user can scroll down to see the rest of it if needed. More info: twbs/bootstrap#23378 closes odoo#69644 X-original-commit: d360b75 Signed-off-by: David Monjoie (dmo) <[email protected]>
That worked for me! thank you |
Loving the new popper.js but was wondering if there was a way to disable the custom styles it auto adds to elements?
Its adding the following:
This in turn overrides some custom animations I am trying to implement, it also messes up alignment if I wanted to put dropddowns in a container. The plugin is great but there must be a way to disable this custom "hardcode" style feature?
The text was updated successfully, but these errors were encountered: