floating-ui
floating-ui copied to clipboard
A JavaScript library to position floating elements and create interactions for them.
Currently, the library doesn't handle very well scenarios in which the reference and the floating elements are rendered in two different documents — for example, when the reference is inside...
[QUESTION/FEATURE REQUEST] Include margins in flip and other middleware (offsetHeight/offsetWidth)
We are building a design system based toolkit and as such all our size, spacing, and such foundational values come from design tokens and are either unit-less or in relative...
Closes #1869 ## What This PR adds better support for cases where the reference and the floating elements are in two different documents — for example, if the reference is...
[React DOM Interactions / FloatingOverlay] Is it possible to use together with the react-toastify?
I'm using modal window from your example together with the react-toastify module. When modal window is open and toast are shown, I'm trying to close the toast, but together with...
## Code: ```tsx const { x, y, reference, floating } = useFloating({ placement: "top", middleware: [shift({ mainAxis: false })], }); return ( ... ... ) ``` ## Error Output ```...
[core] `limitShift`: add option to pass an offset amount that is always added to the min/max values
Currently, the `limitShift` function considers two types of "offsets" [when computing the min/max limits](https://github.com/floating-ui/floating-ui/blob/15d1f49b966f9cf472141749f6ebdb4c75e62d5d/packages/core/src/middleware/shift.ts#L176-L213) for the `shift` middleware: - the offset from the `offset` middleware (added - the offset from...
[DOM] `hide` middleware `referenceHidden` incorrect when reference ancestor is `position: absolute`
For the following HTML structure, hide middleware return `true`, indicate that reference element been hided. Event though its parent is `overflow:hidden` and computed style `height: 0`, actually `position: absolute` make...
**Describe the bug** A clear and concise description of what the bug is. `computePosition()` is not calculating SVG elements as mask in FireFox browser properly. **To Reproduce** https://codesandbox.io/p/sandbox/adoring-black-phg3gd?file=%2Fsrc%2Findex.js Steps to...
**Describe the bug** A clear and concise description of what the bug is. # `width`, `height` get properties of rect are loss when using object spreading from DOMRect instance I'm...