Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default pointer-events style from "auto" to undefined #504

Merged
merged 1 commit into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion e2e/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const getScrollable = async (page: Page) => {
};

export const getVirtualizer = async (page: Page) => {
const selector = '*[style*="pointer-events: auto"]';
const selector = '*[style*="flex: 0 0 auto"]';
const component = await page.waitForSelector(selector, { state: "attached" });
await component.evaluate((e) => (e.style.visibility = "visible"));
await page.waitForSelector(selector);
Expand Down
2 changes: 1 addition & 1 deletion src/react/VGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@
scrollBy: scroller._scrollBy,
};
},
[]

Check warning on line 319 in src/react/VGrid.tsx

View workflow job for this annotation

GitHub Actions / check

React Hook useImperativeHandle has missing dependencies: 'hStore', 'scroller._scrollBy', 'scroller._scrollTo', 'scroller._scrollToIndex', and 'vStore'. Either include them or remove the dependency array
);

const render = useMemo(() => {
Expand Down Expand Up @@ -404,7 +404,7 @@
vScrollDirection !== SCROLL_IDLE ||
hScrollDirection !== SCROLL_IDLE
? "none"
: "auto",
: undefined,
}}
>
{items}
Expand Down
2 changes: 1 addition & 1 deletion src/react/Virtualizer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@
if (!onRangeChangeProp) return;

onRangeChangeProp(startIndex, endIndex);
}, [startIndex, endIndex]);

Check warning on line 315 in src/react/Virtualizer.tsx

View workflow job for this annotation

GitHub Actions / check

React Hook useEffect has a missing dependency: 'onRangeChangeProp'. Either include it or remove the dependency array. If 'onRangeChangeProp' changes too often, find the parent component that defines it and wrap that definition in useCallback

useImperativeHandle(
ref,
Expand All @@ -336,7 +336,7 @@
scrollBy: scroller._scrollBy,
};
},
[]

Check warning on line 339 in src/react/Virtualizer.tsx

View workflow job for this annotation

GitHub Actions / check

React Hook useImperativeHandle has missing dependencies: 'scroller._scrollBy', 'scroller._scrollTo', 'scroller._scrollToIndex', and 'store'. Either include them or remove the dependency array
);

for (let i = overscanedRangeStart, j = overscanedRangeEnd; i <= j; i++) {
Expand Down Expand Up @@ -370,7 +370,7 @@
visibility: "hidden", // TODO replace with other optimization methods
width: isHorizontal ? totalSize : "100%",
height: isHorizontal ? "100%" : totalSize,
pointerEvents: scrollDirection !== SCROLL_IDLE ? "none" : "auto",
pointerEvents: scrollDirection !== SCROLL_IDLE ? "none" : undefined,
}}
>
{items}
Expand Down
2 changes: 1 addition & 1 deletion src/react/WindowVirtualizer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
if (!onRangeChangeProp) return;

onRangeChangeProp(startIndex, endIndex);
}, [startIndex, endIndex]);

Check warning on line 219 in src/react/WindowVirtualizer.tsx

View workflow job for this annotation

GitHub Actions / check

React Hook useEffect has a missing dependency: 'onRangeChangeProp'. Either include it or remove the dependency array. If 'onRangeChangeProp' changes too often, find the parent component that defines it and wrap that definition in useCallback

useImperativeHandle(
ref,
Expand All @@ -227,7 +227,7 @@
},
};
},
[]

Check warning on line 230 in src/react/WindowVirtualizer.tsx

View workflow job for this annotation

GitHub Actions / check

React Hook useImperativeHandle has a missing dependency: 'store'. Either include it or remove the dependency array
);

for (
Expand Down Expand Up @@ -267,7 +267,7 @@
visibility: "hidden", // TODO replace with other optimization methods
width: isHorizontal ? totalSize : "100%",
height: isHorizontal ? "100%" : totalSize,
pointerEvents: scrollDirection !== SCROLL_IDLE ? "none" : "auto",
pointerEvents: scrollDirection !== SCROLL_IDLE ? "none" : undefined,
}}
>
{items}
Expand Down
2 changes: 1 addition & 1 deletion src/react/__snapshots__/VGrid.rtl.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ exports[`rtl > should work 1`] = `
style="overflow: auto; contain: strict; width: 100%; height: 100%;"
>
<div
style="overflow-anchor: none; flex: 0 0 auto; position: relative; visibility: hidden; width: 10000px; height: 4040px; pointer-events: auto;"
style="overflow-anchor: none; flex: 0 0 auto; position: relative; visibility: hidden; width: 10000px; height: 4040px;"
>
<div
style="display: grid; margin: 0px; padding: 0px; position: absolute; top: 0px; right: 0px; visibility: visible; min-height: 50px; min-width: 100px;"
Expand Down
20 changes: 10 additions & 10 deletions src/react/__snapshots__/VGrid.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ exports[`grid > should render 1 children 1`] = `
style="overflow: auto; contain: strict; width: 100%; height: 100%;"
>
<div
style="overflow-anchor: none; flex: 0 0 auto; position: relative; visibility: hidden; width: 100px; height: 50px; pointer-events: auto;"
style="overflow-anchor: none; flex: 0 0 auto; position: relative; visibility: hidden; width: 100px; height: 50px;"
>
<div
style="display: grid; margin: 0px; padding: 0px; position: absolute; top: 0px; left: 0px; visibility: visible; min-height: 50px; min-width: 100px;"
Expand All @@ -26,7 +26,7 @@ exports[`grid > should render 4x4 children 1`] = `
style="overflow: auto; contain: strict; width: 100%; height: 100%;"
>
<div
style="overflow-anchor: none; flex: 0 0 auto; position: relative; visibility: hidden; width: 400px; height: 200px; pointer-events: auto;"
style="overflow-anchor: none; flex: 0 0 auto; position: relative; visibility: hidden; width: 400px; height: 200px;"
>
<div
style="display: grid; margin: 0px; padding: 0px; position: absolute; top: 0px; left: 0px; visibility: visible; min-height: 50px; min-width: 100px;"
Expand Down Expand Up @@ -151,7 +151,7 @@ exports[`grid > should render 100x100 children 1`] = `
style="overflow: auto; contain: strict; width: 100%; height: 100%;"
>
<div
style="overflow-anchor: none; flex: 0 0 auto; position: relative; visibility: hidden; width: 10000px; height: 4040px; pointer-events: auto;"
style="overflow-anchor: none; flex: 0 0 auto; position: relative; visibility: hidden; width: 10000px; height: 4040px;"
>
<div
style="display: grid; margin: 0px; padding: 0px; position: absolute; top: 0px; left: 0px; visibility: visible; min-height: 50px; min-width: 100px;"
Expand Down Expand Up @@ -276,7 +276,7 @@ exports[`grid > should render 1000x1000 children 1`] = `
style="overflow: auto; contain: strict; width: 100%; height: 100%;"
>
<div
style="overflow-anchor: none; flex: 0 0 auto; position: relative; visibility: hidden; width: 100000px; height: 40040px; pointer-events: auto;"
style="overflow-anchor: none; flex: 0 0 auto; position: relative; visibility: hidden; width: 100000px; height: 40040px;"
>
<div
style="display: grid; margin: 0px; padding: 0px; position: absolute; top: 0px; left: 0px; visibility: visible; min-height: 50px; min-width: 100px;"
Expand Down Expand Up @@ -401,7 +401,7 @@ exports[`grid > should render 10000x10000 children 1`] = `
style="overflow: auto; contain: strict; width: 100%; height: 100%;"
>
<div
style="overflow-anchor: none; flex: 0 0 auto; position: relative; visibility: hidden; width: 1000000px; height: 400040px; pointer-events: auto;"
style="overflow-anchor: none; flex: 0 0 auto; position: relative; visibility: hidden; width: 1000000px; height: 400040px;"
>
<div
style="display: grid; margin: 0px; padding: 0px; position: absolute; top: 0px; left: 0px; visibility: visible; min-height: 50px; min-width: 100px;"
Expand Down Expand Up @@ -526,7 +526,7 @@ exports[`grid > should render component 1`] = `
style="overflow: auto; contain: strict; width: 100%; height: 100%;"
>
<div
style="overflow-anchor: none; flex: 0 0 auto; position: relative; visibility: hidden; width: 10000px; height: 4040px; pointer-events: auto;"
style="overflow-anchor: none; flex: 0 0 auto; position: relative; visibility: hidden; width: 10000px; height: 4040px;"
>
<div
style="display: grid; margin: 0px; padding: 0px; position: absolute; top: 0px; left: 0px; visibility: visible; min-height: 50px; min-width: 100px;"
Expand Down Expand Up @@ -651,7 +651,7 @@ exports[`grid > should render fragments 1`] = `
style="overflow: auto; contain: strict; width: 100%; height: 100%;"
>
<div
style="overflow-anchor: none; flex: 0 0 auto; position: relative; visibility: hidden; width: 100px; height: 100px; pointer-events: auto;"
style="overflow-anchor: none; flex: 0 0 auto; position: relative; visibility: hidden; width: 100px; height: 100px;"
>
<div
style="display: grid; margin: 0px; padding: 0px; position: absolute; top: 0px; left: 0px; visibility: visible; min-height: 50px; min-width: 100px;"
Expand Down Expand Up @@ -684,7 +684,7 @@ exports[`grid > should render non elements 1`] = `
style="overflow: auto; contain: strict; width: 100%; height: 100%;"
>
<div
style="overflow-anchor: none; flex: 0 0 auto; position: relative; visibility: hidden; width: 100px; height: 280px; pointer-events: auto;"
style="overflow-anchor: none; flex: 0 0 auto; position: relative; visibility: hidden; width: 100px; height: 280px;"
>
<div
style="display: grid; margin: 0px; padding: 0px; position: absolute; top: 0px; left: 0px; visibility: visible; min-height: 50px; min-width: 100px;"
Expand All @@ -711,7 +711,7 @@ exports[`grid > should render with given width / height 1`] = `
style="overflow: auto; contain: strict; width: 100px; height: 100px;"
>
<div
style="overflow-anchor: none; flex: 0 0 auto; position: relative; visibility: hidden; width: 400px; height: 200px; pointer-events: auto;"
style="overflow-anchor: none; flex: 0 0 auto; position: relative; visibility: hidden; width: 400px; height: 200px;"
>
<div
style="display: grid; margin: 0px; padding: 0px; position: absolute; top: 0px; left: 0px; visibility: visible; min-height: 50px; min-width: 100px;"
Expand Down Expand Up @@ -841,7 +841,7 @@ exports[`should pass attributes to element 1`] = `
tabindex="0"
>
<div
style="overflow-anchor: none; flex: 0 0 auto; position: relative; visibility: hidden; width: 10000px; height: 4040px; pointer-events: auto;"
style="overflow-anchor: none; flex: 0 0 auto; position: relative; visibility: hidden; width: 10000px; height: 4040px;"
>
<div
style="display: grid; margin: 0px; padding: 0px; position: absolute; top: 0px; left: 0px; visibility: visible; min-height: 50px; min-width: 100px;"
Expand Down
4 changes: 2 additions & 2 deletions src/react/__snapshots__/VGrid.ssr.spec.tsx.snap

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/react/__snapshots__/VList.rtl.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ exports[`rtl > should not work in vertical 1`] = `
style="display: block; overflow-y: auto; contain: strict; width: 100%; height: 100%;"
>
<div
style="overflow-anchor: none; flex: 0 0 auto; position: relative; visibility: hidden; width: 100%; height: 5000px; pointer-events: auto;"
style="overflow-anchor: none; flex: 0 0 auto; position: relative; visibility: hidden; width: 100%; height: 5000px;"
>
<div
style="margin: 0px; padding: 0px; position: absolute; width: 100%; left: 0px; top: 0px; visibility: visible;"
Expand Down Expand Up @@ -61,7 +61,7 @@ exports[`rtl > should work in horizontal 1`] = `
style="display: inline-block; overflow-x: auto; contain: strict; width: 100%; height: 100%;"
>
<div
style="overflow-anchor: none; flex: 0 0 auto; position: relative; visibility: hidden; width: 10000px; height: 100%; pointer-events: auto;"
style="overflow-anchor: none; flex: 0 0 auto; position: relative; visibility: hidden; width: 10000px; height: 100%;"
>
<div
style="margin: 0px; padding: 0px; position: absolute; height: 100%; top: 0px; right: 0px; visibility: visible; display: flex;"
Expand Down
Loading
Loading