You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
as the subject states, I find I'm unable to select multiple items across different sortable lists. To replicate, follow these steps (using given code sandbox above):
hold down the cmd key (on win, you can change it to ctrl if preferred)
use a mouse or pointer to select "one" and "two". both should turn yellow
still holding down cmd, use the mouse to select "five".
see that "one" and "two" were deselected as a result.
What I expected: "five" should be selected along with "one" and "two" retaining their selections.
Digging into the code in sortable.js, I find that I can make this work by commenting out
I'm wondering if there's a less hack-ish way to do this? edit to add: Workaround code that lives outside of modifying the Sortable.js file itself would also be gladly welcome.
Also unsure if commenting out those two lines has undesired side effects, although I've not observed any obvious ones so far (so far being a really short duration).
@guanxun14 I've never thought of that, nor have I tried it, but if you don't observe any side effects then its probably fine :)
There is no right way to do it, if you found a way to make the library work for you then you are doing it right.
As for not modifying Sortable code, you could probably remove the event listener by calling document.removeEventListener('mouseup', sortableInstance._deselectMultiDrag) after initializing a Sortable instance.
Custom
Reproduction
codesandbox: https://codesandbox.io/s/eager-boyd-cz63v
as the subject states, I find I'm unable to select multiple items across different sortable lists. To replicate, follow these steps (using given code sandbox above):
cmd
key (on win, you can change it toctrl
if preferred)cmd
, use the mouse to select "five".What I expected: "five" should be selected along with "one" and "two" retaining their selections.
Digging into the code in sortable.js, I find that I can make this work by commenting out
on(document, 'mouseup', this._deselectMultiDrag);
Sortable/plugins/MultiDrag/MultiDrag.js
Line 42 in daaefed
multiDragSortable.multiDrag._deselectMultiDrag();
Sortable/plugins/MultiDrag/MultiDrag.js
Line 524 in daaefed
I'm wondering if there's a less hack-ish way to do this? edit to add: Workaround code that lives outside of modifying the Sortable.js file itself would also be gladly welcome.
Also unsure if commenting out those two lines has undesired side effects, although I've not observed any obvious ones so far (so far being a really short duration).
Thanks!
Related discussion in #1612
The text was updated successfully, but these errors were encountered: