Skip to main content
May 13, 2023 9:04 AM UTC
Solved

Mouse enter/leave flickering

Sorry I don’t really know how to explain this. I have a menu, while hovering with the mouse you should have a more options on each category. I made a classic mouse enter = open overlay / mouse leaves = close overlay, but in the preview, it keeps flickering when approaching the button area, like one pixel tells mouse enter and the next pixel triggers the mouse leave event, next pixel triggers mouse enter, etc.

Please take a very quick look and tell me if it’s a bug or if I made a mistake, thank you.

flickering mouse enter / mouse leave project

This topic has been closed for replies.
djv
djvSolution
Community Support
May 15, 2023 5:07 PM UTC

Sorry to hear this is happening, @Ioan_G_TyraelThas!

Please reach out to the support team directly via this form for help: https://help.figma.com/hc/en-us/requests/new

Please use your Figma account email, include a link to the file, and share it with support-share@figma.com, so they can take a closer look.

27 replies

Loize
Sep 13, 2023 8:06 AM UTC

I also have the same issue. It’s annoying that still there’s no solution for it.

martianchen
Sep 22, 2023 9:46 AM UTC

A solution that worked for me (not a workaround):

Basically I was running into a similar problem with the flicker. In my case, I was trying to use a “mouse enter” transition to navigate to a new frame to do a header nav colour change when my cursor entered a diff section. The flicker was because my scroll position was resetting during the transition and getting triggered over and over again in a continous loop as my cursor was entering a different trigger section after the scroll reset.

Here’s Figma’s documentation on this:

Figma Learn - Help Center

The old state management did not track your top level layer / frame name, therefore you could mouse-enter / mouse-leave and trigger a frame change to any frame with any naming convention and it would not glitch out (transition from a “Page-A” frame to a “Page-B” frame).

But now with the new state management rules, the flicker we have all been facing could likely be due to a layer name issue. In order to ensure that the flicker doesn’t happen by ensuring that the scroll position does not reset, you have to use the same name for your top level frame (e.g. both frames are called “Home”), or at the very least, they must share the same prefix (e.g. “Home/B” and “Home/B”).

Doing this instantly fixed the flicker for me and allowed me to do most of the complex prototyping actions under the old state management rules, hopefully it works for everyone else as well.

Sep 23, 2023 12:54 AM UTC

Thank you!!

Oct 6, 2023 4:05 PM UTC

Adding to this thought because I found the same “solution”. However, it doesn’t seem like it’s just about the mouse being on top of the overlay itself. It seems to be that the event is triggered with every (even slight) move of the mouse within a minuscule amount of time. The reason is that if I hover over my main navigation button (that triggers the overlay) and keep my mouse moving, I get the flicker, but if I ever so slightly move the mouse and get it to stop within [whatever that loop Figma has checking for mouse movement], I can get the overlay to stay open (or stay closed for that matter). That makes the moment of mouse transition into the overlay critical because that could be the moment it closes it, or the moment it opens its. Either way, it’s the overlay-triggering button causing the issue and that slight delay helps buffer that loop that’s checking for mouse movement. I can even add a delay as tiny as 1ms and it “fixes” it.

Oct 6, 2023 4:21 PM UTC

I should add to my last post just moments ago — if you add a dissolve to the overlay (as opposed to “instant”) it throws the whole “solution” out the window. The timing issue becomes unsurmountable. Really, really annoying.

Borja3
Nov 5, 2023 5:08 PM UTC

Thanks for sharing it! It worked.

pixelpusher
Dec 21, 2023 12:02 AM UTC

I’m experiencing the exact same issue… all my old prototypes that have a weird ‘Mouse move inside’ and ‘Mouse move outside’ work just fine. I get a flickering of other hoverable (either while hovering or mouse enter) elements in the main overlay. So basically I have a row that I hover over to display a dropshadow and icon, and then when I hover over the icon I get a tooltip, but that tooltip flickers like crazy. Used to always work without issue and without creating any components. I don’t want to create any unnecessary interactive components… I’ve tried the naming solution and the delay solution and both did not work for me…