Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

:hover gets wrong events #367

Closed
wbecker opened this issue Sep 25, 2015 · 3 comments
Closed

:hover gets wrong events #367

wbecker opened this issue Sep 25, 2015 · 3 comments
Labels

Comments

@wbecker
Copy link

wbecker commented Sep 25, 2015

I have several rows which have hover styles. If I move my mouse over them slowly everything is fine.

When I move the mouse over them quickly I found that the hover styles were remaining.

I logged the e.target of the events that were happening onMouseEnter and onMouseLeave in resolve-interaction-styles-plugin.js and found that when the hover style was not being removed -e.target had the value of the next element that was entered, not the value that was left.

So this doesn't seem like the fault of radium, but it seems like something you may need to deal with! I would expect :hover to be a unique property that can only exist on a single element - it should not be able to get into a state where two different elements have the hover state at the same time.

I guess this implies some sort of global state than ensures this?

@ianobermiller
Copy link
Contributor

Can you provide a repro in jsbin or similar? Also, what browser/os? In the examples there is a grid of 10x10 squares with :hover on each one, does it repro there for you?

@wbecker
Copy link
Author

wbecker commented Sep 25, 2015

I'll have a try - but you can see in the code here that it relies upon the assumption of an onLeave matching an onEnter. If this assumption ever breaks for whatever reason you will have this issue.

@ianobermiller
Copy link
Contributor

I'm a bit bothered we haven't properly solved this, but I can't think of a good way to ensure only a single stack is hovered (child and all parents). Closing for now.

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

No branches or pull requests

2 participants