fix: Avoid crashing when updated triggered before rendering#46
fix: Avoid crashing when updated triggered before rendering#46SylvainBigonneau wants to merge 1 commit intoSortableJS:masterfrom
Conversation
fix: Switch fix to safer place
5ace299 to
d94ff11
Compare
|
@SylvainBigonneau Do you have an example of such problems? |
|
Hello @SylvainBigonneau and @David-Desmaisons ! We are currently moving the Crisp app to Vue 3, and it uses vue.draggable We are facing the exact problem. In our case, the :list key is based on a computed properly, itself based on a VueX array. In a such case, a race condition seems to occur in the draggable component, and This PR seems to fix the problem |
|
Well, we just found the root of this problem :) Since we are moving our app from Vue 2 to Vue 3, we are using the @vue/compat package. We are now using this: By disabling the RENDER_FUNCTION we are forcing Vue to use the Vue 3 render mode. |
|
If I patch the parts of the code with that fix I still get an error with this.context is null when onDragStart is triggered. I figured out that it has to do with keys that aren't applied to the transitition-group if tag="transition-group" is set on the draggable component. SortableJS/Vue.Draggable#144 |
|
In which version of vuedraggable or vue-draggable-next we can get above fixes..i am also facing same issue? |
This fixes an error that occurs when the list is first rendered empty: in some cases, upon adding the first item, it will not be rendered yet, therefore
_ref.elwill benullwhen it is checked and this crashes the lib.