Skip to content

Commit

Permalink
fix: 修复父容器存在 transform 时, 在 canvas 内点击也会重置交互的问题 close #2879 (#2942)
Browse files Browse the repository at this point in the history
  • Loading branch information
lijinke666 committed Oct 25, 2024
1 parent 5bdc365 commit 010ed05
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions packages/s2-core/src/interaction/event-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,11 @@ export class EventController {
return false;
}

// 开启 CSS transform 时, 降级处理, 不做 canvas 内的空白检测: https://github.com/antvis/S2/issues/2879
if (this.spreadsheet.container.getConfig().supportsCSSTransform) {
return canvas.contains(event.target as HTMLElement);
}

return this.isMatchElement(event) && this.isMatchPoint(event);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/s2-react/playground/config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ export const s2Options: SheetComponentOptions = {
},
transformCanvasConfig() {
return {
supportsCSSTransform: true,
supportsCSSTransform: false,
supportsPointerEvents: false,
// dblClickSpeed: 500,
// devicePixelRatio: 3,
Expand Down

0 comments on commit 010ed05

Please sign in to comment.