Skip to content

Commit

Permalink
Change default pointer-events style from "auto" to undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
inokawa committed Aug 29, 2024
1 parent 63e9285 commit 33b5e3a
Show file tree
Hide file tree
Showing 22 changed files with 124 additions and 113 deletions.
2 changes: 1 addition & 1 deletion src/react/VGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ export const VGrid = forwardRef<VGridHandle, VGridProps>(
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 @@ -370,7 +370,7 @@ export const Virtualizer = forwardRef<VirtualizerHandle, VirtualizerProps>(
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 @@ -267,7 +267,7 @@ export const WindowVirtualizer = forwardRef<
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

0 comments on commit 33b5e3a

Please sign in to comment.