-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1174 from VisActor/release/0.20.1
[Auto release] release 0.20.1
- Loading branch information
Showing
57 changed files
with
610 additions
and
271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[{"definitionName":"lockStepVersion","policyName":"vtableMain","version":"0.20.0","mainProject":"@visactor/vtable","nextBump":"minor"}] | ||
[{"definitionName":"lockStepVersion","policyName":"vtableMain","version":"0.20.1","mainProject":"@visactor/vtable","nextBump":"patch"}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
docs/assets/faq/en/21-How to cancel the bubbling of the table event.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# How to cancel the bubbling of the table mousedown event | ||
|
||
## Problem Description | ||
|
||
In my business scenario, I need to drag the entire table to move the position. However, if the mouse point is dragged on the cell, it will trigger the box selection interaction of the table. In this way, I do not expect to drag the entire table. When the mouse point is clicked, Then respond to the entire table dragging behavior in the blank area of the table. | ||
|
||
Based on this demand background, how to determine whether the click is on a cell or a blank area of the table? | ||
|
||
## solution | ||
|
||
This problem can be handled in VTable by listening to the `mousedown_cell` event, but it should be noted that VTable internally listens to pointer events! | ||
|
||
Therefore, if you cancel bubbling directly, you can only cancel the pointerdown event. | ||
``` | ||
tableInstance.on('mousedown_cell', arg => { | ||
arg.event.stopPropagation(); | ||
}); | ||
``` | ||
Therefore, you need to listen to mousedown again to determine the organization event. For correct processing, you can see the following example: | ||
|
||
## Code Example | ||
|
||
```javascript | ||
const tableInstance = new VTable.ListTable(option); | ||
window.tableInstance = tableInstance; | ||
let isPointerDownOnTable = false; | ||
tableInstance.on('mousedown_cell', arg => { | ||
isPointerDownOnTable = true; | ||
setTimeout(() => { | ||
isPointerDownOnTable = false; | ||
}, 0); | ||
arg.event?.stopPropagation(); | ||
}); | ||
tableInstance.getElement().addEventListener('mousedown', e => { | ||
if (isPointerDownOnTable) { | ||
e.stopPropagation(); | ||
} | ||
}); | ||
``` | ||
## Related documents | ||
- [Tutorial](https://visactor.io/vtable/guide/Event/event_list) | ||
- [github](https://github.com/VisActor/VTable) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
docs/assets/faq/zh/21-How to cancel the bubbling of the table event.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# 怎么取消表格mousedown事件的冒泡 | ||
|
||
## 问题描述 | ||
|
||
在我的业务场景中需要对表格整体进行拖拽来移动位置,但是如果鼠标点在单元格上拖拽会触发表格的框选交互,这样我就预期不进行整表拖拽了,当鼠标点在表格空白区域再响应整表拖拽行为。 | ||
|
||
基于这个需求背景,怎么判断是点击在了单元格上还是表格空白区域呢? | ||
|
||
## 解决方案 | ||
|
||
在 VTable 中可以通过监听`mousedown_cell`事件来处理这个问题,不过需要注意的是VTable内部都是监听的pointer事件哦! | ||
|
||
所以如果直接取消冒泡,也仅能取消pointerdown事件。 | ||
``` | ||
tableInstance.on('mousedown_cell', arg => { | ||
arg.event.stopPropagation(); | ||
}); | ||
``` | ||
所以需要再监听mousedown来判断组织事件,正确处理可以看下面示例: | ||
|
||
## 代码示例 | ||
|
||
```javascript | ||
const tableInstance = new VTable.ListTable(option); | ||
window.tableInstance = tableInstance; | ||
let isPointerDownOnTable = false; | ||
tableInstance.on('mousedown_cell', arg => { | ||
isPointerDownOnTable = true; | ||
setTimeout(() => { | ||
isPointerDownOnTable = false; | ||
}, 0); | ||
arg.event?.stopPropagation(); | ||
}); | ||
tableInstance.getElement().addEventListener('mousedown', e => { | ||
if (isPointerDownOnTable) { | ||
e.stopPropagation(); | ||
} | ||
}); | ||
``` | ||
## 相关文档 | ||
- [教程](https://visactor.io/vtable/guide/Event/event_list) | ||
- [github](https://github.com/VisActor/VTable) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.