Skip to main content

Event listeners

  • September 14, 2023
  • 2 replies
  • 418 views

Frederic_Fornini

Event listeners could improve prototypes efficiency and limit the number of workaround to replicate common interactions on websites.

  1. OnScrollUp OnScrollDown (left or right as well for Horizontal scroll with an offset value)
    E.G : Menu expanding on scrolling up.
    Right now this is almost impossible to simulate, while being a pretty common thing.
    (i mean yes, with increasing a number variable or decreasing it and check the previous result, which asks for a lot of onMouseEnter and possibly deactivating other interactions).

It would be great to listen when user is going up or down the page.

  1. OnView (with offset trigger and possibly onLeave)
    For example we have a page with sticky elements, like filters, that need to disappear when the footer enters the visible area of our prototype.
    As of now, we need onMouseEnter interaction to change visible state with booleans.
    This is a problem, because people won’t be able to see these interactions when on mobile.

So triggering a bloc when it is onView would result in much simpler and friendly mobile interactions.

3.CursorPosition, Element position (relative or absolute)
To simulate mouse following elements, for mouse changing states.

I’m pretty sure this might be something you’re onto already, these would be really be nice additions.

Regards

Drew19
  • November 25, 2024

I absolutely agree.

A basic event listener that lets us broadcast an event name and parameters would save tons of time creating multiple variables to manage the state of a single component.

Even just being able to add watchers would be a great time saver! How many state/value variables could we eliminate if we could just add a watcher to a component so that when the value of a variable changes, the component runs logic or sets variables without user input.

“Interactions” should not be limited to user actions and timeouts. They could also include programmatic interactions such as “On Variable Change”, or “On Event”.


Alex_Hart

The lack of event listeners in Figma is becoming a bigger and bigger obstacle for my team. It would be such a game-changer for our prototyping—the workarounds we use (i.e. delay timer trigger, big invisible ‘mouse-in’ rectangles) are time-consuming and unreliable. 

 

It’s great that we now have variables and conditional logic in Figma, but I don’t find those features especially useful if a variable change can’t trigger an action.  


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings