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
Confusing documentation with boundaries (how to ensure flip with floating navbar?) #518
Comments
You should define an offset. |
@FezVrasta how do I do that btw? It says its an Object, but is it |
I am also confused by the offset implementation/documentation. Sorry, I tried. I got frustrated. |
I basically want to set a pixel offset from the top of the viewport and the left of the viewport. |
Same problem here. @FezVrasta, can you please be more specific about there to define the offset? Thanks! |
Sorry I thought Popper.js already supported it but it seems like it doesn't. Ideally we should have an option for As workaround you may have your layout structured like this:
One below the other, so that you can set I haven't tried it, but I'm quite sure you may also provide as Sorry for the confusion. |
A real simple way to fix this is to change lines 72-75 in getBoundaries.js lines to: boundaries.left += padding.left || padding; |
@BrianBu01 feel free to fork this repo, do your changes and send a pull request. Thanks! 🤩 |
@BrianBu01 This didn't help in my case. Am I doing something wrong? How does this update work? |
For me after the change my code using Popper would be:
|
Thank you! This solves my problem. For the default 50px tall bootstrap navbar the code looks like this:
Can't wait to see your PR pulled in! |
@beowulfenator I made additional changes to that method which are pending. |
feat: Add specific padding to boundaries (floating-ui#518)
Here is a codepen just in case someone needs it. |
Hey! Thanks for the update. Unfortunately it gives error with typescript. Because types aren't updated. @FezVrasta Is there any hope to get it fixed? |
@kasparsuvi1 I'm not a TypeScript user, but feel free to send a PR to fix that |
Made PR #750 for that. |
I have a
.navbar-fixed-top
(using Bootstrap 3 and implementing a custom Popper instance).Trying to figure out how to make it so when you scroll down the page, a popover that begins to be hidden underneath a fixed top navbar will get flipped automatically.
I tried passing a
modifiers.flip.boundariesElement
option, but that didn't seem to work.Is there any way to do a simple "reduce viewport top size by X pixels?" where X is the height of the floating navbar?
The text was updated successfully, but these errors were encountered: