Skip to content

Commit

Permalink
fix: prevent highlighting new edge (antvis#3170)
Browse files Browse the repository at this point in the history
  • Loading branch information
NewByVector authored Jan 28, 2023
1 parent e3e7cfc commit bd30f7f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion packages/x6/src/view/edge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2191,7 +2191,9 @@ export class EdgeView<
for (let i = 0, ii = cells.length; i < ii; i += 1) {
const view = graph.findViewByCell(cells[i])

if (!view) {
// Prevent highlighting new edge
// Close https://github.com/antvis/X6/issues/2853
if (!view || view.cell.id === this.cell.id) {
continue
}

Expand Down
4 changes: 2 additions & 2 deletions sites/x6-sites/docs/tutorial/plugins/selection.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ graph.use(
| className | string | - | | 附加样式名,用于定制样式 |
| multiple | boolean | `true` | | 是否启用点击多选,启用后按住 `ctrl``command` 键点击节点实现多选 |
| multipleSelectionModifiers | ModifierKey | `['ctrl', 'meta']` | | 用于设置上面点击多选配套的修饰键 |
| rubberband | boolean | `false` | | 是否启用多选节点功能 |
| modifiers | ModifierKey | - | | 设置修饰键后需要点击鼠标并按下修饰键才能触发多选 |
| rubberband | boolean | `false` | | 是否启用框选节点功能 |
| modifiers | ModifierKey | - | | 用于设置上面框选配套的修饰键 |
| strict | boolean | `false` | | 选框是否需要完全包围节点时才选中节点 |
| movable | boolean | `true` | | 拖动选框时框选的节点是否一起移动 |
| content | string | - | | 设置附加显示的内容 |
Expand Down

0 comments on commit bd30f7f

Please sign in to comment.