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

onClick event cannot prevent bubbling #89

Closed hhbusui closed 2 years ago

hhbusui commented 2 years ago

Environments

The components are the latest version

Description

Hello, author. When I used this component, I found that onclick and onmouseup did not trigger. Is there any good solution?

My real goal is to stop bubbling after the mouse is down.

daybrush commented 2 years ago

@h1530687053

selecto's new version is released.

You can use preventClickEventOnDragStart or preventClickEventOnDrag

    // Prevent click event on drag. (mousemove, touchmove)
    preventClickEventOnDrag?: boolean;
    // Prevent click event on dragStart. (mousedown, touchstart)
    preventClickEventOnDragStart?: boolean;
hhbusui commented 2 years ago

Excellent,It works perfect! Thank you for your effort.