Skip to content

Commit 67ba80e

Browse files
committed
Alternate overflow options
1 parent c1a9649 commit 67ba80e

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Diff for: src/polyfill.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -441,12 +441,13 @@ async function checkOverflow(target: HTMLElement, offsetParent: HTMLElement) {
441441
y: target.offsetTop,
442442
platform: platformWithCache,
443443
rects,
444-
elements: { floating: target },
444+
elements: {
445+
floating: target,
446+
reference: offsetParent,
447+
},
445448
strategy: 'absolute',
446449
} as unknown as MiddlewareState,
447450
{
448-
boundary: offsetParent,
449-
rootBoundary: 'document',
450451
padding: getMargins(target),
451452
},
452453
);

Diff for: tests/e2e/polyfill.test.ts

+2
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ test('updates when sizes change', async ({ page }) => {
110110
test('applies polyfill for `@position-fallback`', async ({ page }) => {
111111
const targetSel = '#my-target-fallback';
112112
const target = page.locator(targetSel);
113+
await target.scrollIntoViewIfNeeded();
113114

114115
await expect(target).toHaveCSS('left', '0px');
115116

@@ -124,6 +125,7 @@ test('applies polyfill for `@position-fallback`', async ({ page }) => {
124125
});
125126

126127
await expect(target).toHaveCSS('width', '100px');
128+
await expect(target).toHaveCSS('height', '100px');
127129
});
128130

129131
test('applies manual polyfill', async ({ page }) => {

0 commit comments

Comments
 (0)