daybrush / selecto

Selecto.js is a component that allows you to select elements in the drag area using the mouse or touch.
https://daybrush.com/selecto
MIT License
2.04k stars 82 forks source link

How to disable drag events only while keeping click events? #121

Open Larthas opened 1 year ago

Larthas commented 1 year ago

Environments

Description

I'm trying to use Selecto in my project and I'd like to disable drag events while keeping click events active. If I use "dragCondition" to return false, the whole Selecto has been disabled.

daybrush commented 1 year ago

@Larthas

Try calling the e.preventDrag() function in the onDragStart event.