antvis / antvis/X6

antv/x6 锚点点击 node:port:mousedown 事件无法触发

Open
#4,649 4 comments 0 reactions 0 assignees View on GitHub
help wanted oscp
Dominant language
TypeScript
Stars
6.7k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

### 问题描述

点击连接桩是 会自动触发连接
思考解决:
1 使用node:port:mousedown 事件处理,发现 node:port:mousedown 事件根本无法触发
2 使用 validateMagnet 解决 发现 validateMagnet 的触发时机很早,无法插手,比如 我想利用原生mousedown 和 mouseup 的事件差值来控制 是否启动validateMagnet ,发现validateMagnet 执行很早
3 使用 node:port:click 发现也比 validateMagnet 执行时机晚

### 重现链接

### 重现步骤

点击连接桩是 会自动触发连接
思考解决:
1 使用node:port:mousedown 事件处理,发现 node:port:mousedown 事件根本无法触发
2 使用 validateMagnet 解决 发现 validateMagnet 的触发时机很早,无法插手,比如 我想利用原生mousedown 和 mouseup 的事件差值来控制 是否启动validateMagnet ,发现validateMagnet 执行很早
3 使用 node:port:click 发现也比 validateMagnet 执行时机晚

### 预期行为

期望可以有 连接桩 点击 后 不立马触发连线操作

### 平台

- 操作系统: [macOS, Windows, Linux, React Native ...]
- 网页浏览器: [Google Chrome, Safari, Firefox ...]
- X6 版本: [2.11.1 ...]

### 屏幕截图或视频(可选)

_No response_

### 补充说明(可选)

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by tracing the event flow for node:port:mousedown, node:port:click, and validateMagnet in the port-connection entry points, then reproduce the timing described in the issue. Done means a port click does not immediately start a connection while the intended connection interaction still works; add or update a regression test if the existing test suite covers this behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.