Possible "native" double click function

I have a group and I would like a single click to trigger one workflow, but a fast double click should trigger a different workflow.

I have a custom state (number). Set default 0.

The group has two workflow with the following condition;

When group is clicked set state ⇾ 1
When group is clicked again set state ⇾ 0

This enables a double click action, but there needs to be a time limit between clicks, so that >1 second will reset the custom state back to 0.

Is there a way (a timer) to make custom state 1 trigger a workflow Only when the group was clicked <1 second ago?

I have tried adding a custom event to the workflow which resets back to 0 Only when custom state is 1. This successfully resets the number to 0 but prevents the double click action.

Just schedule a custom event to reset the custom state after 1 second.

e.g.

Double Click (bubbleapps.io)

2 Likes

Ah that looks spot on, I will be testing this later today but thank you for the demo example mate.

I’ve updated my app and the double click works great, thank you for taking time to help me (and everyone else you help).

This is actually a pretty funny solution…but works perfectly great! Thanks for also sharing a test page :smiley:

Why is it ‘funny’?

I have a better way to do this:

  1. add a state to the button called something like “last click” and set its type to date;
  2. run the desired actions if the following is true: “last click date > current date/time”;
  3. set the state “last click” to “current date/time + 1 second” if the following is true: “last click date < current date/time”.

Just that!

Nice idea :slight_smile: