Skip to content

Commit

Permalink
fix: Avoid crashing when updated triggered before rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
SylvainBigonneau committed May 6, 2021
1 parent f66e77a commit 5ace299
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/componentStructure.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const getHtmlElementFromNode = ({ el }) => el;
const getHtmlElementFromNode = ({ el }) => el || {};
const addContext = (domElement, context) =>
(domElement.__draggable_context = context);
const getContext = domElement => domElement.__draggable_context;
Expand Down
2 changes: 1 addition & 1 deletion src/vuedraggable.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ const draggableComponent = defineComponent({
},

updated() {
this.componentStructure.updated();
this.$nextTick(() => this.componentStructure.updated());
},

beforeUnmount() {
Expand Down

0 comments on commit 5ace299

Please sign in to comment.