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
Applying custom transformation on popper #73
Comments
Yes sure, here is where Popper.js computes the styles that need to be applied to the popper element. After that, the
You can then inject a custom modifier after |
Thanks for the quick reply @FezVrasta, and thank you for pointing me in the right direction. This helped me achieve what I wanted. However I did get to it only after a bit of trial and error. For example, what eventually worked for me was this:
What I did not understand is why it was necessary for me to change the offsets and styles objects to make this work? Is this the correct way I should go to achieve the desired effect? Sorry for the vague question - I am just making sure I am not missing anything as I am still studying this library :) Thank you for your help. |
Bueller? Would be great to know if the solution is a hack or considered idiomatic. :) |
the modifier system is at the core of Popper.js, feel free to use it, definitely not an hack! |
Hi,
I am trying to apply a custom transformation to the
popper
element, depending on weather the popper is visible or not.To be more specific, I am implementing a tooltip component that holds a state of
isVisible
.Based on this state, I would like to apply a custom
style
object on popper with my own CSS value fortransform
.For example, If the tooltip isn't visible I would like to position it slightly higher (relative to the target), so that once it becomes visible again, I will be able to animate it.
Is there a way for me to intervene with the calculation of the to-be applied style and make changes to it to force popper render with these styles?
Thanks,
The text was updated successfully, but these errors were encountered: