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

[4.0] mouseenter and mouseleave are ineffective for g-svg #205

Closed
1 task done
dengfuping opened this issue Oct 14, 2019 · 2 comments
Closed
1 task done

[4.0] mouseenter and mouseleave are ineffective for g-svg #205

dengfuping opened this issue Oct 14, 2019 · 2 comments
Labels

Comments

@dengfuping
Copy link
Member

dengfuping commented Oct 14, 2019

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

  • Use mouse to enter and leave circle.

What is expected?

  • The fill of circle should be changed.

What is actually happening?

  • The fill of circle is not changed.
Environment Info
g-svg 0.1.0-beta.3
System Mac OS
Browser Google Chrome 77.0.3865.90
@dengfuping
Copy link
Member Author

dengfuping commented Oct 15, 2019

  • 原因分析: 对于 SVG 来说,进入子元素会触发画布的 mouseout 事件和子元素的 mouseover 事件。而在 Canvas 中是使用 mousemove 去模拟的,实现上没有考虑 SVG 元素本身就会触发事件。
  • 解决方法: 应该要禁止除画布外的所有 SVG 元素自身的事件。

@dengfuping
Copy link
Member Author

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

No branches or pull requests

1 participant