diff --git a/packages/s2-core/src/facet/base-facet.ts b/packages/s2-core/src/facet/base-facet.ts index c665ff7a11..4a4724026b 100644 --- a/packages/s2-core/src/facet/base-facet.ts +++ b/packages/s2-core/src/facet/base-facet.ts @@ -199,6 +199,7 @@ export abstract class BaseFacet { const originEvent = ev.event; const { deltaX, deltaY, x, y } = ev; // The coordinates of mobile and pc are three times different + // TODO: 手指快速往上滚动时, deltaY 有时会为负数, 导致向下滚动时然后回弹, 看起来就像表格在抖动, 需要判断滚动方向, next 版本未复现 this.onWheel({ ...originEvent, deltaX, @@ -930,9 +931,14 @@ export abstract class BaseFacet { }; private stopScrollChaining = (event: WheelEvent) => { - event?.preventDefault?.(); + if (event?.cancelable) { + event?.preventDefault?.(); + } // 移动端的 prevent 存在于 originalEvent上 - (event as unknown as GraphEvent)?.originalEvent?.preventDefault?.(); + const mobileEvent = (event as unknown as GraphEvent)?.originalEvent; + if (mobileEvent?.cancelable) { + mobileEvent?.preventDefault?.(); + } }; onWheel = (event: WheelEvent) => { diff --git a/packages/s2-core/src/sheet-type/spread-sheet.ts b/packages/s2-core/src/sheet-type/spread-sheet.ts index 7fff55540e..2381339e2d 100644 --- a/packages/s2-core/src/sheet-type/spread-sheet.ts +++ b/packages/s2-core/src/sheet-type/spread-sheet.ts @@ -6,7 +6,6 @@ import { get, includes, isEmpty, - isEqual, isFunction, isString, memoize, diff --git a/packages/s2-react/playground/index.html b/packages/s2-react/playground/index.html index 13576bda2a..901bfef23c 100644 --- a/packages/s2-react/playground/index.html +++ b/packages/s2-react/playground/index.html @@ -8,6 +8,5 @@
- -