Skip to content
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:修复笔记本触摸板点击节点事件失效 #1465

Merged
merged 1 commit into from
Feb 5, 2024

Conversation

wuchenguang1998
Copy link
Contributor

修复issue#1071:笔记本触摸板点击节点时并没有触发node:click事件。
原代码判断逻辑为:mousedown和click间隔时间大于200ms,则认为是拖拽,不触发click事件。
这样判断并不是最优方式, 原因:
1.当使用触摸板点击时,时间间隔大于200ms,具体是210ms-240ms之间,导致没有触发node:click事件。
2.当单次拖拽操作很短的情况下(在200ms内),按照原代码,会触发node:click事件,这与期望不符。
本次提交的改动:对节点增加mouseup监听,对拖拽状态isDragging状态进行记录,在handleClick中进行判断,确保在鼠标及触摸板点击时都能正常触发node:click事件。

@ijry
Copy link

ijry commented Jan 5, 2024

点赞

@wumail
Copy link
Collaborator

wumail commented Jan 5, 2024

@boyongjiong 👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants