diff --git a/src/common-components/textbox-question/textbox-question.vue b/src/common-components/textbox-question/textbox-question.vue index 565655a11..9c25a8bc7 100644 --- a/src/common-components/textbox-question/textbox-question.vue +++ b/src/common-components/textbox-question/textbox-question.vue @@ -133,12 +133,16 @@ export default { this.isLoading = true; await this.dispatchStoreAction(storeActions.LOOKUP_VIN_BY_IMAGE, e.target.files[0]) .then(async (response) => { - this.value = response.data.length > 0 ? response.data[0] : ""; + if (response.data.length > 0) { + this.value = response.data[0]; - // Wait for DOM to update before firing change event to handle validation. - await this.$nextTick(); + // Wait for DOM to update before firing change event to handle validation. + await this.$nextTick(); - document.getElementById(this.inputId).dispatchEvent(new Event("change")); + document.getElementById(this.inputId).dispatchEvent(new Event("change")); + } else { + this.$emit("imageLookupError"); + } }) .catch((error) => { this.$emit("imageLookupError");