Sortable
Sortable copied to clipboard
[bug] 'multiDragKey' is too simple to support the combination of Ctrl/Shift+ left click operations such as windows explorer files select.
As mentioned above, based on [email protected] and <table> or grid layout, left-click can select a single item, Ctrl+ left-click can select one item by one, Shift+ left-click can select a batch, and can drag and drop selected items for sorting operation. Ctrl+ left-click will not cause any problems, just like the MultiDrag plugin logic. But pure left-click and Shift+ left-click are problematic.
Pure left-click: when you click 2 or more times, the correct logic is to select a single item, but in MultiDrag, every item that is clicked is selected.
Shift+ left click: All items in the middle of the 2 clicks should be selected, but in the MultiDrag plugin, only the 2 clicks are selected.
Can you provide two hook functions, such as ‘beforeSelect’ and ‘beforeDeselect’, that return true or false to determine whether MultiDrag should select click items? Or provide two config functions, such as ‘select' and ’deselect’, that override the default selection behavior.
Or is there a better way?
In addition, to maintain the differences and usage habits between operating systems, on MacOS, the combination of buttons selected one by one is the 'Command' key, but the MultiDrag can only be selected between the Ctrl and Command keys.
直接修改代码好了,默认关闭多选,只允许shift ctrl多选。双击空白区域清空选择。
直接修改代码好了,默认关闭多选,只允许shift ctrl多选。双击空白区域清空选择。
请问怎么清空选择呀