Skip to main content

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

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”.


Reply