From 50d74952dae4a3f6257e6d3907e557981510f226 Mon Sep 17 00:00:00 2001 From: Zheng-Xiang Ke Date: Wed, 13 Apr 2022 12:37:28 +0800 Subject: [PATCH] Nullity check for $refs.root (#254) --- src/component.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/component.js b/src/component.js index 6415cab..a45b930 100644 --- a/src/component.js +++ b/src/component.js @@ -204,7 +204,7 @@ export default { */ modelValue(newValue) { // Prevent updates if v-model value is same as input's current value - if (newValue === nullify(this.$refs.root.value)) return; + if (!this.$refs.root || newValue === nullify(this.$refs.root.value)) return; // Make sure we have a flatpickr instance this.fp && // Notify flatpickr instance that there is a change in value