Comments (5)
Hmm, yeah I see that as well. Not sure what would cause it so will need some investigating.
transform: translate(-50%,-50%)
A new "containing block" gets created in this situation, and most positioning bugs that appear now seem to be related to handling this layout situation
Looks like it's related to collision detection when using shift()
. When removing that middleware, it's positioned correctly. One possible workaround is to use an empty boundary shift({ boundary: [] })
instead of the default clippingAncestors
. Now it will only detect the root viewport collision instead of the incorrectly-calculated clippingAncestors
, which may be fine in many situations with top-layer elements...
from floating-ui.
Yeah most likely the same issue, if you add boundary: []
for hide()
as well, it should work. This also goes for autoPlacement
, and any other visibility-optimizer ones that perform collision detection.
from floating-ui.
from floating-ui.
It is working fine on a small screen; however, if I go fullscreen on this page (https://vitejsvitejzzg6c-drf5--5173--7dbe22a9.local-credentialless.webcontainer.io/) and open the drawer, then clicking on the input field to open the panel causes the floating panel's position to be incorrect.
from floating-ui.
Hmm, yeah I see that as well. Not sure what would cause it so will need some investigating.
transform: translate(-50%,-50%)
A new "containing block" gets created in this situation, and most positioning bugs that appear now seem to be related to handling this layout situation
Looks like it's related to collision detection when using
shift()
. When removing that middleware, it's positioned correctly. One possible workaround is to use an empty boundaryshift({ boundary: [] })
instead of the defaultclippingAncestors
. Now it will only detect the root viewport collision instead of the incorrectly-calculatedclippingAncestors
, which may be fine in many situations with top-layer elements...
Thank you for sharing the workaround. There is one more issue I found in our application regarding the issue with the hide middleware, it seems that it returns 'hide', which might be causing the panel to not open consistently. Do you think this could be related to the same issue you mentioned earlier
If I set the display property based on the hide flag, the panel always remains closed.
export function useFloatingUI(trigger: any, panel: any) {
computePosition(trigger, panel, {
middleware: middleware,
strategy: 'fixed',
}).then(({ x, y, middlewareData }) => {
const { hide } = middlewareData;
Object.assign(panel.style, {
left: `0px`,
top: `0px`,
transform: `translate(${x}px, ${y}px)`,
// display:hide ? 'none': 'block'
});
});
}
from floating-ui.
Related Issues (20)
- arrow middleware break other middleware HOT 1
- [React] `refs.floating.current` is `null` inside `useEffect` when using `FloatingPortal` HOT 3
- popper misplaced on Y axis HOT 1
- Angular 17 - RangeError: Maximum call stack size exceeded on getComputedStyle HOT 2
- `autoUpdate` calls `updatePosition` continuously when the floating element is clipped by a parent with overflow hidden. HOT 4
- When using FloatingOverlay tabbing within a floating does not bring element into view HOT 2
- focus is visible even if keyboard is not being used HOT 2
- useDismiss not working when click on iframe elements HOT 1
- webcomponent floating UI: Panel Positioning Issue HOT 4
- Adaptive function HOT 2
- autoUpdate never settle when reference is in a scrollable div HOT 1
- The tooltip should be visible when I hover over it. HOT 1
- UnPKG version is not currently working HOT 1
- Reference error: process is not defined HOT 3
- List navigation doesn't scroll to selected item when other focusable elements are present in popover HOT 2
- Tooltip position is not updated when resizing window HOT 2
- Duplicate generated type aliases HOT 6
- isPositioned never gets updated on Safari and Firefox HOT 1
- Implicit dependency on React 18 typings HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from floating-ui.