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,
|
||||
default: () => ''
|
||||
},
|
||||
initialErrors: Array,
|
||||
initialErrors: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
paragraph: String,
|
||||
noMaxWidth: String
|
||||
},
|
||||
@ -30,7 +33,7 @@ export default {
|
||||
mask: inputValidations[this.validation].mask,
|
||||
pipe: inputValidations[this.validation].pipe || undefined,
|
||||
keepCharPositions: inputValidations[this.validation].keepCharPositions || false,
|
||||
validationError: inputValidations[this.validation].validationError || '',
|
||||
validationError: this.initialErrors.join(' ') || inputValidations[this.validation].validationError,
|
||||
value: this.initialValue,
|
||||
modified: false
|
||||
}
|
||||
@ -82,6 +85,10 @@ export default {
|
||||
valid = false
|
||||
}
|
||||
|
||||
if (this.modified) {
|
||||
this.validationError = inputValidations[this.validation].validationError
|
||||
}
|
||||
|
||||
// Show error messages or not
|
||||
if (valid) {
|
||||
this.showError = false
|
||||
|
Loading…
x
Reference in New Issue
Block a user