mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user