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 authored Oct 25, 2024
1 parent 53c04dc commit cfc45b7
Showing 1 changed file with 5 additions and 0 deletions.
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 @@ -206,6 +206,11 @@ export class EventController {
return false;
}

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

const { x, y } = canvas.getBoundingClientRect() || {};
// 这里不能使用 bounding rect 的 width 和 height, 高清适配后 canvas 实际宽高会变
// 比如实际 400 * 300 => hd (800 * 600)
Expand Down

0 comments on commit cfc45b7

Please sign in to comment.