Skip to content

Commit 0eb5157

Browse files
committed
fix: sortable element undefined error with new beforeUnmount hook
1 parent 89177dc commit 0eb5157

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-draggable-next",
3-
"version": "1.0.7",
3+
"version": "1.0.8",
44
"description": "",
55
"main": "dist/vue-draggable-next.cjs.js",
66
"browser": "dist/vue-draggable-next.esm.js",

src/VueDraggableNext.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,10 @@ export const VueDraggableNext = defineComponent({
179179
},
180180

181181
beforeUnmount() {
182-
if (this._sortable !== undefined) this._sortable.destroy()
182+
try {
183+
if (this._sortable !== undefined) this._sortable.destroy()
184+
} catch (error) {
185+
}
183186
},
184187

185188
computed: {

0 commit comments

Comments
 (0)