Skip to content

Commit d8bef2a

Browse files
ignatvilesovВилесов Игнат Михайлович
authored andcommitted
fix: change popover position to fixed to resolve position issues in absolute layouts
1 parent 0b2f551 commit d8bef2a

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

.changeset/beige-pets-hang.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@qwik-ui/headless': patch
3+
---
4+
5+
fixes popover position issue in absolute layouts by changing its position strategy to "fixed"

packages/kit-headless/src/components/popover/floating.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export const FloatingPopover = component$((props: PropsOf<'div'>) => {
5858
await computePosition(anchor as ReferenceElement, popover, {
5959
placement: placement as Placement,
6060
middleware,
61+
strategy: 'fixed',
6162
}).then(async (resolvedData) => {
6263
const { x, y } = resolvedData;
6364

packages/kit-headless/src/components/popover/popover.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
padding: unset;
1818
border: unset;
1919
overflow: unset;
20-
position: absolute;
20+
position: fixed;
2121
}
2222
}
2323

@@ -28,6 +28,6 @@
2828
padding: unset;
2929
border: unset;
3030
overflow: unset;
31-
position: absolute;
31+
position: fixed;
3232
}
3333
}

0 commit comments

Comments
 (0)