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

鼠标离开edge时,清除其他小工具,会使edge-editor消失,编辑会失败 #4239

Closed
Li-0221 opened this issue Mar 27, 2024 · 4 comments

Comments

@Li-0221
Copy link

Li-0221 commented Mar 27, 2024

Describe the bug

  • 在edge上添加edge-editor工具
  • 在鼠标移入edge时添加['vertices', 'segments', 'button-remove']工具
  • 鼠标移出时移除['vertices', 'segments', 'button-remove']工具
  • edge-editor消失,编辑失败

复现连接 https://codesandbox.io/p/sandbox/mo-ban-forked-9fzfqs?file=%2Fsrc%2FApp.tsx%3A66%2C12

Your Example Website or App

https://codesandbox.io/p/sandbox/mo-ban-forked-9fzfqs?file=%2Fsrc%2FApp.tsx%3A66%2C12

Steps to Reproduce the Bug or Issue

  • 在edge上添加edge-editor工具
  • 在鼠标移入edge时添加['vertices', 'segments', 'button-remove']工具
  • 鼠标移出时移除['vertices', 'segments', 'button-remove']工具
  • edge-editor消失,编辑失败

Expected behavior

鼠标移出edge,清楚其他工具,edge-editor不消失

Screenshots or Videos

2024-03-27.17.39.53.mov

Platform

  • OS:macOS
  • Browser: Edge
  • Version: 版本 123.0.2420.53 (正式版本) (arm64)

Additional context

No response

@x6-bot
Copy link
Contributor

x6-bot bot commented Mar 27, 2024

👋 @Li-0221

Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it.
To help make it easier for us to investigate your issue, please follow the contributing guidelines.
We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

@Li-0221
Copy link
Author

Li-0221 commented Mar 27, 2024

我看到与 #3574 类似

@Li-0221 Li-0221 closed this as completed Mar 27, 2024
@gthdweb
Copy link

gthdweb commented Jun 4, 2024

我是使用延迟方法能够解决此问题,希望有更好的方式能够解决这个问题。
// edge hover移除删除按钮
graph.on('edge:mouseleave', ({ edge }) => {
setTimeout(() => {
//立即移除会导致edge-editor输入内容消失
edge.removeTool('button-remove');
}, 499);
});

@JoryPai
Copy link

JoryPai commented Jul 30, 2024

+1

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

No branches or pull requests

3 participants