Can a button lead to a different action based on how long the user presses it?

I would like the button to lead to one action when simply pressed and lead to another action when pressed for 3 seconds.

I tried some things with custom states when the button is pressed but there doesn’t seem to be a way to add values to an input field by simply pressing a button.

You could then have a workflow start when the ‘counter’ reaches a certain number (for example 3 seconds).

You can create a timer that counts down when you click on a button but it doesn’t know the difference between clicked or pressed. You can also not set a custom state to the button when you press it to distinguish clicked from pressed. But I still think that the ‘pressed’ state would be key in this issue!

Definitely an interesting feature though.Sorry I couldn’t be of more help, maybe someone else has a better approach!

1 Like

I wasn’t able to find anything in the MDN documentation for the DOM event “click”:

I scanned over some Stack Overflow articles about using JavaScript and shallowly concluded a timer would be the best way.

It may be possible, but I don’t think it’d be easy or even desired. It’s somewhat of an unexpected UI feature…most typical users would not expect a different behavior on a long press with a mouse.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.