-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Integrate MultiDrag plugin. #744
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
Conversation
Thanks for this. |
I found an issue. Multi Drag doesn't seem to work when dragging multiple items from one list to another. The problem seems to be with onDragAddList and onDragRemoveList when they call this.spliceList. spliceList modifies this.value and emits the change but this.value stays exactly the same until the next tick. |
I created a pull request on @divinespear 's fork with a proposed fix. |
fixed multi-drag from one list to another
Thanks @Flip535 for the fix. However, when multi-dragging objects from one list to another, there is still sometimes an error: |
Im not able to reproduce that. There may be something special about your use case. Can you provide an example? |
@Flip535
Have a look at helper.js:32. That's where the error occurs. Suppose I have one list with 4 items. I drag 3 of them to another list. The argument |
I think i may have the fix for that. Try this out and let me know if it works: |
@Flip535 Great, I pulled your fork and it works now! Thanks! |
…ultiple items from one list to another. Also the umd.js dist builds were not working so i fixed that too.
2 Fixes, Umd builds and Drag Error
Any updates on if multi-drag is operational yet? Let me know if you can! Thanks! |
I am currently using the fork in production. It seems to be working well for our use case. |
@zherman91 I will begin the review this week-end. This may take time as I will need to add missing tests and validate all these impacting changes. |
@David-Desmaisons - Thanks for the update! Can't wait for that functionality so let me know when you can. I really appreciate your time! Thanks. |
hello,你好! |
@Tulipyuyu It's based on SortableJS, and it has good MultiDrag plugin. |
Hi @David-Desmaisons : Do you have any idea which version is going to include this feature? |
@SerhiyRomanov that looks not normal case. |
@divinespear Yes, you are right, seems like this is not allowed behaviour. |
Is this MR ready? |
Can't wait to see this official |
I'm having trouble accessing the I'm creating components like this:
They are working fine, MultiDrag is possible. However, when I want to select items programmatically, that's not possible because
Is that a problem on my side? I am using the latest commit of the fork, everything else is working fine. When adding debugging output in
Maybe a different instance of sortablejs is used? Thanks for your help! |
@TimoZikeli I've made a quick test, creating a new Vue app and adding this fork as dep, this code in App.vue works as expected: <template>
<div>
</div>
</template>
<script>
import Draggable from 'vuedraggable'
import { MultiDrag } from 'sortablejs'
export default {
mounted(){
console.log(MultiDrag.singleton.utils)
}
}
</script> |
Thanks! That's very strange... I added debugging output in |
Here the {
"name": "test-vue-multidrag",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^3.6.5",
"vue": "^2.6.11",
"vuedraggable": "git+https://github.com/divinespear/Vue.Draggable.git"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"vue-template-compiler": "^2.6.11"
}
} |
Thank you, I deleted the |
@divinespear Can you please check my problem again? Now here is the test repo as requesed: https://github.com/stemyke/vue-multidrag-test Unfortunately you have to do a lot of dragging to reproduce the problem. Plesae be aware that there is a timeout which reselects the previously selected rows after dragging, so you need to wait 500ms after each drag. Usuall I test it with 3 selected rows. You can only select the rows with the checkboxes and you can drag them with he "[X]" placeholder. Thanks in advance! |
Hi @David-Desmaisons , is there maybe a time-frame for when this may be merged to the master branch and be released as part of vue-draggable? |
@bkyf I am currently working on porting the lib to vue 3. Regarding this feature for version 2, it may be an option if it can be backported without major changes |
+1 |
any update? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
thanks!
…------------------ 原始邮件 ------------------
发件人: "Jean-Jacques-Nuoan"<notifications@github.com>;
发送时间: 2021年2月18日(星期四) 晚上6:13
收件人: "SortableJS/Vue.Draggable"<Vue.Draggable@noreply.github.com>;
抄送: "Y☆♧U"<1048037636@qq.com>; "Mention"<mention@noreply.github.com>;
主题: Re: [SortableJS/Vue.Draggable] Integrate MultiDrag plugin. (#744)
@divinespear请你再检查一下我的问题好吗?现在这是我要求的测试报告:
https://github.com/stemyke/vue-multidrag-test
不幸的是,您必须做大量的拖动来重现问题。请注意,有一个超时,重新选择以前选定的行后拖动,所以您需要等待500毫秒后,每拖动。通常我用3个选定的行测试它。您只能选择带有复选框的行,并且可以用“[X]”占位符拖动它们。先谢谢了!
@stemyke我使用的是你的vuedraggable依赖版本,这是写在package.json。完全有效!然而,当我拖放不连续的内容,它不能很好地工作。调试后发现multidrag插件中的一些代码不能达到我想要的效果,下面是dispatchupdate事件的截图和代码你能帮我解决这个问题吗?谢啦!
//如果初始折叠完成,元素可能已经改变了位置,因为它们现在//在dragEl周围展开,即使dragEl可能没有更改他的索引,所以更新事件//必须在这里被解雇,因为Sortable不会。如果(OldIndex===指数(龙)){让更新=假;多灾多难.For每(多重网格=>{如果(多重网格.舒适指数!==指数(多重网格)){更新=真实的;返回;}});如果(更新){DispatchSorableEvent(“已更新”);}}}
下面是索引方法:
/***返回元素在其父元素中的索引,用于选定的*元素*@param{HTML元素{耳}*@param{选择器{选择器*@return{数字}*/功能指数(埃尔,选择器){让指数=0;如果(!埃尔||!埃尔.父节点){返回-1;}/*张鑫老板:真*/正在…(埃尔=埃尔.上一元素){如果((埃尔.节点名.升级版()!==“时间”)&&埃尔!==可分类的.克隆&&(!选择器||火柴(埃尔,选择器))){指数++;}}返回指数;}
我认为sortableIndex变量与这个index方法的返回不匹配。用这种方法来确定是不合适的。
我发现这种版本的vuedragable可能不适合从一个列表多拖动到另一个,只适合从同一个列表的多拖动
—
你收到这个是因为你被提到了。
直接回复此邮件,在GitHub上查看,或取消订阅.
|
Any Update? When will multi drag be possible? |
Hi guys, |
Hey @divinespear, i really appreciate this work, thank you very much :-) @David-Desmaisons Thank you very much for your support :-) Is something missing for this merge? |
@edvinkuric I have two main concerns with this PR (beside the lack of time on my side): Point 1 means that at least to merge the PR, I have to deep dive into the code, in order to cover the code with new tests.
@divinespear (I know it is late) If you could work on this two points it will help to get the PR merged |
…into multi-drag
@David-Desmaisons I'll make new PR and close this when I think my turn is done. |
OK I think my turn is end. moved to #1052 |
I got some work... releated #104, #536, #649 🚀