Drag clickable objects without triggering them

How do I…

I have an inventory, basically list of object that i’m displaying, you can clic on each of them to get a modal of detail. This is fine, it works. But i want this inventory to be scrollable and i’m having a issue without any idea of how i can resolve that.

What is the expected result

I want to :

  • be able to “scroll” without triggering the “click”
  • be able to click without triggering the scroll

But how can i differentiate the two as they both work on pressing the button…
Should i work on a “timing” based solution ? What’s the best practice here ?

Related screenshots


One method would be to use a timer and check how long the mouse down or touch has been active - if it’s over a threshold then scroll, otherwise click. But this won’t allow for a lingering mouse down/touch.

An alternative is to see how far the cursor has moved since the mouse down/touch began. If it’s over a threshold, scroll. If the mouse or touch finishes and scrolling hasn’t occurred, then click.

Thanks for the confirmation !

Actually i found this super simple to do … i use a simple timer, and consider the threshold to < 0.1 sec as Clic/Touch… i works fine to me.

Thanks @MrMen !

The trigger of timer and scroll :

And here : The condition to trigger the Modal details

2 Likes