Popover is behind element even with FloatingPortal
See original GitHub issueI am trying to use a FloatingPortal to take the floating elements outside the flow of the document.
However, I am still seeing odd behaviour when the popover should be on top of an element.
Current code:
MyPopover.js
const { x, y, reference, floating, strategy } = useFloating({
placement: "bottom-start",
middleware: [flip(), shift(), offset(5)],
})
...
<>
<Popover.Button
ref={reference}
className={contentContainerStyle}
/>
<Popover.Panel
static
ref={floating}
style={{
position: strategy,
top: y ?? "",
left: x ?? "",
}}
>
...
</Popover.Panel>
</>
App.js
const AppWithStore = () => {
return (
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<FloatingPortal>
<App />
</FloatingPortal>
</PersistGate>
</Provider>
)
}
What am I missing to take the floating UI out of the flow of the document?
Versions: “@floating-ui/react-dom”: “^0.6.3”, “@floating-ui/react-dom-interactions”: “^0.3.1”,
Issue Analytics
- State:
- Created a year ago
- Comments:6
Top Results From Across the Web
Bootstrap 3 Popover gets hidden behind the element which ...
I usually add(or toggle) a CSS to an element I want to control instead of adding CSS attributes to it. So instead of:....
Read more >Tutorial | Floating UI
Create a new HTML document with two elements, a <button> and a tooltip <div> : ... apply a tooltip or popover to an...
Read more >Popover has wrong z-index and gets hidden behind the nav bar
The popup button is on the navbar, but the message gets hidden underneath. I checked it with Firebug and it seems navbar has...
Read more >Popovers - Bootstrap
Documentation and examples for adding Bootstrap popovers, like those found in iOS, to any element on your site.
Read more >Popover | Components - BootstrapVue
The Popover feature provides a tooltip-like behavior, can be easily applied to any interactive element via the component or v-b-popover directive.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The
FloatingPortal
should only wrap the floating element, not the whole app. Further, you may need to set az-index
on the floating element if there are other positioned elements that can obscure it.isolation: isolate
on the root app (not the floating portal node) may also help (cc: @FezVrasta still have no idea how that works lol)The code in the docs was not working for me for some reason.
This is the only hack / code that managed to get it working: