Cherry-pick: Tie changes to validation flow
This commit is contained in:
parent
f7b9b79cfb
commit
f4eed79845
1 changed files with 9 additions and 2 deletions
|
|
@ -123,8 +123,15 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
async submitImage(e) {
|
async submitImage(e) {
|
||||||
await this.dispatchStoreAction(storeActions.LOOKUP_VIN_BY_IMAGE, e.target.files[0])
|
await this.dispatchStoreAction(storeActions.LOOKUP_VIN_BY_IMAGE, e.target.files[0])
|
||||||
.then((response) => {
|
.then(async (response) => {
|
||||||
document.getElementById(this.inputId).value = response.data;
|
this.value = response.data.length > 0 ? response.data[0] : "";
|
||||||
|
|
||||||
|
// Wait for DOM to update before firing change event to handle validation.
|
||||||
|
await this.$nextTick();
|
||||||
|
|
||||||
|
document.getElementById(this.inputId).dispatchEvent(
|
||||||
|
new Event('change')
|
||||||
|
);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue