Skip to content

Commit 38a86b1

Browse files
authored
this._sortable undefined in beforeDestroy Hook
There is an edge case in which this._sortable is undefined in the beforeDestroy Hook. This edge case can be seen when unmaximizing the screen to a size in which elements will be re-ordered when using bootstrap grid than maximizing and then minimizing again, now the error shows. This edit fixes this error but still after the first unmaximize after a refresh of the page the <draggable> element just disappears, still trying to find this issue
1 parent 9cda2af commit 38a86b1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/vuedraggable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
},
129129

130130
beforeDestroy() {
131-
this._sortable.destroy()
131+
if(this._sortable !== null && this._sortable !== undefined) this._sortable.destroy();
132132
},
133133

134134
computed: {

0 commit comments

Comments
 (0)