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

怎么避免拖动元素 移出画布 #1055

Open
bilimumu1576 opened this issue Jan 24, 2024 · 1 comment
Open

怎么避免拖动元素 移出画布 #1055

bilimumu1576 opened this issue Jan 24, 2024 · 1 comment

Comments

@bilimumu1576
Copy link

1.能否给个判定出界的方案 阻止移动可以

@shyser
Copy link

shyser commented Mar 26, 2024

在drag事件中判断是否超出边界,超出时主动触发mouseup事件,中断鼠标的拖拽。

e.target.__zr.handler.dispatchToElement({target: e.target}, 'mouseup', e.event)

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

2 participants