-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multidrag select across sortables #2181
base: master
Are you sure you want to change the base?
multidrag select across sortables #2181
Conversation
This is great! And I've updated the CodePen example with your patch. A couple of things though… and I'm not sure if they're existing bugs or issues with your patch:
|
Thanks for the feedback @jjeff , I'll have a look at it tomorrow! |
I've added a new commit that should take care of 1 and 2. It turns out I was making a mistake when entering the sortables into the global group map. I falsely expected the option parsing that happens in the constructor of Sortable to already have happened, so did not take in account that To (hopefully) make things somewhat more legible, I separated the "global" part of the I also made a small helper function called As for 3, I'll give it a shot! |
Updated the Code Pen again. The I would probably change those docs to say "A custom keyboard key may be designated as having to be down for the user to be able to select multi-drag-enabled elements." Also FWIW, the MultiDrag Options Example shows |
Aha! This is good to know. I'll see what I can do. |
That's strange, this behavior (multidrag not implementing multiDragKey correctly, as stated above) seems to be identical to me on the current EDIT: Wrt the
Commiting a small fix that circumvents the issue of the option listener expecting the value to be a string. EDIT2: Added a commit to make multiDragKey to behave in line with what you detailed above. Again, I do not believe this is how it actually worked before my changes, so if you merge this, be prepared for some confusion from users who might have gotten used to the prior behavior :) With regards to shift-selecting across lists, I believe this is going to be quite tricky to implement, and I have already spent a bit more time on this than the bounty amount really permits. If someone wants to raise another $50 or so in a separate issue I'd be happy to take a look at it. :) |
I've been testing and I'm sometimes getting an error saying:
…which appears to be happening in the And it looks like adding this dragOver({ target, completed, cancel, originalEvent }) {
if (folding && ~multiDragElements.indexOf(target)) {
completed(false);
cancel();
return; // <-- added this
}
const toSortable = target.parentNode[expando]; // <-- this is where the error is happening
// etc I'm not sure I understand the code enough to know if I might be breaking something else. But in my testing, it looks like this solves the problem and (I think) everything is working. EDIT: Actually, I don't think the |
Okay another approach: dragOver(…) {
…
const toSortable = target.parentNode && target.parentNode[expando];
// ^^^^^^^^^^^^^^^^^^^^ This seems to solve the problem. |
53dd0a7
to
05e5343
Compare
87cd7d6
to
355da84
Compare
Thanks @jjeff , I copied your fixes and reverted to the old behavior with |
Great! Thanks, @maxbol. This makes |
I've updated the CodePen example with the latest version of this PR. Works great! Closes #2173 |
Any news about when it possible merge? |
I would also like this feature merged! |
Solves #2173