Closed emilionavarro closed 2 years ago
@emilionavarro
What you are talking about is like the continueSelectWithoutDeselect
option.
Use continueSelectWithoutDeselect
with toggleContinueSelect
.
If you want to use it with a toggle key, use toggleContinueSelectWithoutDeselect
option.
Thank you :)
I will play around with this and post my results.
Thank you @daybrush :)
Thanks again, I believe this is working nicely.
For future references, here's the solution @daybrush suggested.
<Selecto
dragContainer=".container"
selectableTargets={['.item']}
toggleContinueSelect="shift"
toggleContinueSelectWithoutDeselect="shift"
onSelect={(e) => {
e.added.forEach((el) => el.classList.add('selected'));
e.removed.forEach((el) => el.classList.remove('selected'));
}}
/>
Where toggleContinueSelect
and toggleContinueSelectWithoutDeselect
work together to allow for selection without any deselection.
Environments
Framework name: React Framework version: 17.0.2 Component name: React-Selecto Component version: 1.15.1
Description
I'm trying to use
toggleContinueSelect
to only add to the selection and never remove. So when you drag and select a previously selected item, it should not remove. But I can't find a good way to do this.