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

Custom Wrapper fires the onMouseEnter twice #1255

Closed
vforge opened this issue Jan 20, 2019 · 6 comments
Closed

Custom Wrapper fires the onMouseEnter twice #1255

vforge opened this issue Jan 20, 2019 · 6 comments
Labels

Comments

@vforge
Copy link

vforge commented Jan 20, 2019

Current behavior

A very simple custom Wrapper causes component's onMouseOver to fire twice.

To reproduce

Check console when you hover over Button example on https://vforge.github.io/react-styleguidist-mouse-enter-bug/

Source code: https://github.com/vforge/react-styleguidist-mouse-enter-bug

Expected behavior

onMouseEnter should fire only once.

@vforge
Copy link
Author

vforge commented Feb 11, 2019

Is there anything else I can provide in order to reproduce this bug?

@devonmitton
Copy link

I can confirm I'm seeing the same thing. I have a tooltip component that was firing mouseEnter twice when it should only happen once. Only happens when the component is in Styleguidist. Using the component in an app works as expected.

I'm on Styleguidist 7.3.11. I'm in the process of upgrading to the latest version, and I'll follow-up once I've done that.

@devonmitton
Copy link

This is still an issue in 9.0.1

@mendrew
Copy link
Contributor

mendrew commented May 21, 2019

I've tried to do research and found that it's true if component has padding applied.
I've been able to reproduce this directly on component with div around + padding on wrapper div, wrapper component didn't have styles.

I'm not sure, but I've seen an issue in react which is not the same but might be relevant facebook/react#10906 and it says that some onMouseEnter incorrect calculation has been fixed in 16.1.0-beta.

Why I'm talking about it if styleguidist uses newer version of react?

To compile markdown to jsx styleguidist uses markdown-to-jsx module and it uses version 15.6.1 of react https://github.com/probablyup/markdown-to-jsx/blob/9570018bac22c759899be839089cc33d3d739af0/package.json#L60

Could it be possible that during compilation we are getting this incorrect calculation bug for onMouseEnter event because of complier react version?
Is compiler use styleguidist react version during execution? don't know.
I'm still far from understending of how it's all working together and affecting each other.

@thecodejack
Copy link
Contributor

We are facing same issue with v9.

@stale
Copy link

stale bot commented Oct 3, 2019

😴 This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week without any further activity. Consider opening a pull request if you still have this issue or want this feature.

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

4 participants