Use initial errors as validation error until change is made
This fixes a bug where the "Task Order not found" error was not shown.
This commit is contained in:
parent
7d7afebede
commit
9f4663a8d5
@ -18,7 +18,10 @@ export default {
|
|||||||
type: String,
|
type: String,
|
||||||
default: () => ''
|
default: () => ''
|
||||||
},
|
},
|
||||||
initialErrors: Array,
|
initialErrors: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
},
|
||||||
paragraph: String,
|
paragraph: String,
|
||||||
noMaxWidth: String
|
noMaxWidth: String
|
||||||
},
|
},
|
||||||
@ -30,7 +33,7 @@ export default {
|
|||||||
mask: inputValidations[this.validation].mask,
|
mask: inputValidations[this.validation].mask,
|
||||||
pipe: inputValidations[this.validation].pipe || undefined,
|
pipe: inputValidations[this.validation].pipe || undefined,
|
||||||
keepCharPositions: inputValidations[this.validation].keepCharPositions || false,
|
keepCharPositions: inputValidations[this.validation].keepCharPositions || false,
|
||||||
validationError: inputValidations[this.validation].validationError || '',
|
validationError: this.initialErrors.join(' ') || inputValidations[this.validation].validationError,
|
||||||
value: this.initialValue,
|
value: this.initialValue,
|
||||||
modified: false
|
modified: false
|
||||||
}
|
}
|
||||||
@ -82,6 +85,10 @@ export default {
|
|||||||
valid = false
|
valid = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.modified) {
|
||||||
|
this.validationError = inputValidations[this.validation].validationError
|
||||||
|
}
|
||||||
|
|
||||||
// Show error messages or not
|
// Show error messages or not
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.showError = false
|
this.showError = false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user