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.06k stars 84 forks source link

continueSelect without deselection #77

Closed na2793 closed 2 years ago

na2793 commented 2 years ago

Environments

Description

I'm trying to prevent the selected item to be deselected when I press shift key and select it again. Is there any way to make this work? Thanks for your time.

daybrush commented 2 years ago

@na2793

selecto's new version is released.

Use continueSelectWithoutDeselect option with continueSelect. Thank you :)

na2793 commented 2 years ago

As always, thank you!

na2793 commented 2 years ago

I think continueSelectWithoutDeselect is always considered false. It seems to be overridden in the Selecto class' constructor because it wasn't passed in. Please review this issue.

daybrush commented 2 years ago

@na2793

That way it probably won't be set to true. Set continueSelectorWithoutDeselect={true}

na2793 commented 2 years ago

I think my lint settings are confusing you. ={true} is omitted, but it does exist. Even if I write ={true}, the result is the same.

na2793 commented 2 years ago

https://codesandbox.io/s/naughty-hofstadter-dm877d

This is just a fork from the official example, only adding continueSelectorWithoutDeselect={true}. It may be helpful to check this.

daybrush commented 2 years ago

@na2793

oh thank you A bug was confirmed. I will release it again tomorrow.

daybrush commented 2 years ago

@na2793

Test 1.16.2 version. Thank you :)

na2793 commented 2 years ago

It works now. Thank you for your effort!