fix(components): [table-v2] navigation back triggered by trackpad scrolling (#23673)

* fix(components): [table-v2] navigation back triggered by trackpad scrolling

* fix: apply coderabbit suggest

* fix: simplify the code
This commit is contained in:
rzzf
2026-02-21 04:59:06 +08:00
committed by GitHub
parent e53399fae4
commit be0b56574e

View File

@@ -45,7 +45,15 @@ export const useGridWheel = (
y = 0
}
if (hasReachedEdge(x, y)) return
if (hasReachedEdge(x, y)) {
// #23524
// Prevent browser back navigation when the table can still scroll
// horizontally but the Y-axis normalization dropped the X delta and the Y edge was hit instead.
if (e.deltaX !== 0 && x === 0) {
e.preventDefault()
}
return
}
xOffset += x
yOffset += y