-
-
Notifications
You must be signed in to change notification settings - Fork 428
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
Allow Floating Strategy to be Configurable for Popover #1504
Comments
@sean-redteam is it supported by standard Flowbite library? |
Standard Flowbite library does not not use "floating-ui" |
@rluders It could be. It's using Popper which has been migrated to Floating UI. That's what this library uses. My assumption is the strategy wasn't implemented explicitly with Without this update, it won't be possible to use popovers inside elements with overflow values other than |
TBH, I don't know. @sean-redteam did you tried to achieve the same result using the component-theme system? 🤔 |
The styles are being added directly by Floating UI. Customizing the theme doesn't have any effect: It's possible using |
I see... it really seems to be an easy implementation. But, as @SutuSebastian said, it isn't supported by the default Flowbite library. I'm wondering if there is any supported case in the standard library where this behavior can be supported. Maybe @zoltanszogyenyi can help us here. See, I'm not saying "NO"... I'm saying that this is something that first needs to exists at the standard Flowbite library, if this is somehow supported, there is no reason for us to implement it. However, if it isn't supported by the standard Flowbite, we first need to see this supported somehow there or at least not causing inconsistency between the libraries. |
The standard library requires Flowbite JS for the Popover to work. The JS library is using Popper (now Floating UI). Unless I missed something, I don't believe Flowbite React uses the JS library from Flowbite. It has its own implementation; therefore, it's not something that can be added to the standard library to be picked up by this library. Also, @SutuSebastian was just saying the standard library (JS) doesn't use Floating UI, which is technically correct since it's an older version called Popper. Floating UI = Popper v3 Relevant links: |
OK. So, we still wait for the standard Flowbite to support it. |
Summary
Describe how it should work, and provide examples of the solution, which might include screenshots or code snippets.
Hello and thanks for providing this reference implementation for Flowbite. I have a use case for the Popover that is not currently covered but can easily be added.
I am using a Popover component inside of a parent which is
overflow: auto
set. This means the popover is cut off. See screen shot.This is due to
@floating-ui/react
usingposition: absolute
by default.The good news is that
useFloating
has astrategy
prop that can be passed to override this if necessary. In scenarios like mine,position: fixed
is needed. I did some testing, and it works well. See screen shot.The popover is still attached to the reference element and scrolls along with it.
Context
What are you trying to accomplish? How is your use case affected by not having this feature?
Popover
should be updated to accept astrategy
prop of type:This is passed to
useFloating
from the@floating-ui/react
library.Without this feature, popovers are cut off in parents that have overflow other than
visible
.I'm happy to create a PR for this if it will help.
The text was updated successfully, but these errors were encountered: