[BUG] whileHover
state does not reset when element transitions to dragConstraints
#2591
Labels
bug
Something isn't working
Hey folks,
I am seeing an issue where the changes applied during hover with
whileHover
don't properly reset when combined withdrag
anddragConstraints
. The reason seems to be that the hover detection doesn't properly work when the cursor leaves the element due to it transitioning back from its dragged position to its constrained position. The same problems can also be seen when usingdragSnapToOrigin
.Steps to reproduce:
drag
,dragConstraints
andwhileHover
effects.CodeSandbox reproduction: https://codesandbox.io/p/sandbox/framer-motion-hover-bug-49yl5n
Expected behavior: The hovered state should be removed as soon as the cursor is not located over the element anymore, even if this happens due to the element being animated away from the cursor.
Video:
CleanShot.2024-03-23.at.23.58.50.mp4
Please note that the lags in the video during drag & drop are caused by CleanShot X's recording. They aren't actually there.
The text was updated successfully, but these errors were encountered: