Anyway to disable selection by dragging? #154
-
Apologies in advance in case I'm missing something obvious! Is there a way to disable the square that's used to draw the selection? I know about setting the 'multiSelectKeys' property to [], but I'd essentially like to disable selection (and by default, multi-selection) by dragging, altogether. In that case, the only way to select a selectable would be to actually click it or directly drag it. I tried passing in a size-less div to the selector property, but I can see that the 'ds-selector' classed element is still being resized starting from the top left corner and thus, still able to select multiple selectables. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
Not sure if there's a more 'proper' way to do it but this seems to do the job :) .ds-selector{ |
Beta Was this translation helpful? Give feedback.
-
Hi @clementrcheng thanks for using the tool and for opening this question 💪 Aha interesting question. I don't think there is a proper way to do it right now as this is the core functionality of the tool. But if you think this is a valuable addition, let's discuss it. I'm wondering, you just want the rectangle to be disabled, right? You still want the possibility to select multiple elements by clicking on them directly with any multiselect key like for example the Also what is your use-case. Thank you |
Beta Was this translation helpful? Give feedback.
-
The request behaviour is exactly what I need :-) ... I have a list of text items and want just to drag and drop one item per time without the possibility to select more than one item. |
Beta Was this translation helpful? Give feedback.
-
As a workaround I ended up clearing the selection on the callback event. ds.subscribe('callback', ({ isDragging }) => {
if (!isDragging) {
ds.clearSelection();
}
}); I believe that the request is to "turn the selection off completely and only use the drag and drop" as you put it, @ThibaultJanBeyer. (Or rather that only one selection can be active at a time.) |
Beta Was this translation helpful? Give feedback.
As a workaround I ended up clearing the selection on the callback event.
I believe that the request is to "turn the selection off completely and only use the drag and drop" as you put it, @ThibaultJanBeyer. (Or rather that only one selection can be active at a time.)