-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: 增加单元格单双击的判断范围 #2924
fix: 增加单元格单双击的判断范围 #2924
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -545,7 +545,11 @@ export class EventController { | |||
} | |||
|
|||
// 双击的 detail 是 2 | |||
if (event.detail === 2) { | |||
if ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里只是增加容错
Size Change: +53 B (+0.02%) Total Size: 330 kB
ℹ️ View Unchanged
|
@@ -55,7 +55,11 @@ export class DataCellClick extends BaseEvent implements BaseEventImplement { | |||
|
|||
if (interaction.isSelectedCell(cell)) { | |||
// https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail,使用 detail 属性来判断是否是双击,双击时不触发选择态 reset | |||
if ((event.originalEvent as UIEvent)?.detail === 1) { | |||
if ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的逻辑是, 单击单元格时, 如果已经是选中状态, 则取消选中
但目前 G 有 bug, 只有在 click 事件时, 才会在模拟的 FederatedPointerEvent 增加 detail 属性
你好, @lijinke666 CI 执行失败, 请点击 [Details] 按钮查看, 并根据日志修复。 Hello, @lijinke666 CI run failed, please click the [Details] button for detailed log information and fix it. |
@@ -347,6 +347,7 @@ export const s2Options: SheetComponentOptions = { | |||
transformCanvasConfig() { | |||
return { | |||
supportsCSSTransform: true, | |||
supportsPointerEvents: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
原生的 PointerEvent 没有 detail 属性, 只有 MouseEvent 才有, 上层先这样规避下, 对应上面 (event.nativeEvent)
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## next #2924 +/- ##
==========================================
+ Coverage 75.77% 80.83% +5.06%
==========================================
Files 257 180 -77
Lines 11994 10426 -1568
Branches 2464 2363 -101
==========================================
- Hits 9088 8428 -660
+ Misses 1398 554 -844
+ Partials 1508 1444 -64 ☔ View full report in Codecov by Sentry. |
🎉 This PR is included in version @antv/s2-v2.0.0-next.30 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version @antv/s2-react-v2.0.0-next.29 🎉 The release is available on: Your semantic-release bot 📦🚀 |
👀 PR includes
🐛 Bugfix
📝 Description
🖼️ Screenshot
🔗 Related issue link
🔍 Self-Check before the merge