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
2k stars 81 forks source link

Issue with object sticking to the cursor in group selection #153

Open vladdubchak opened 10 months ago

vladdubchak commented 10 months ago

Environments

Description

Hello there!

I am trying to implement a possibility for the user in my app to group several elements. Upon grouping, the user might need to move one of the objects inside the group. Usually, in graphic editors, it works in the way that user needs to double-click on the element inside the group to select it.

The issue is that upon double-clicking, the object sticks to the cursor and starts moving with it, until user hits left mouse button again. Is there a way to avoid this need to detach an element from the cursor?

https://github.com/daybrush/selecto/assets/136099930/53180e23-718a-433d-b04c-7ef5c452e200

In Figma, for example, you simply need to double click on the element in the group, and you can seamlessly move it around the canvas. Any chance this could be fixed, pretty please?

Thanks a mil!

daybrush commented 9 months ago

@vladdubchak

Click occurs when mouseup (double click), (sub-select)

I will add an event that occurs when mouse down (double) is moveable.

vladdubchak commented 9 months ago

Thanks @daybrush , looking forward!