From 3c983e50ea9206cb3ef4b30eaaa2e54c8407fead Mon Sep 17 00:00:00 2001 From: virginieVachet Date: Fri, 6 Dec 2024 15:55:17 +0100 Subject: [PATCH] add resetValidation on Vinput --- .../src/patterns/NirField/NirField.vue | 42 ++++++++++++------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/packages/synapse-bridge/src/patterns/NirField/NirField.vue b/packages/synapse-bridge/src/patterns/NirField/NirField.vue index e0e9c96dd..614c646c2 100644 --- a/packages/synapse-bridge/src/patterns/NirField/NirField.vue +++ b/packages/synapse-bridge/src/patterns/NirField/NirField.vue @@ -210,13 +210,13 @@ export default defineComponent({ return this.isSingleField ? [numberRules] : [ - numberRules, - () => { - this.validateKeyValue(this.maskaKeyValue.unmasked) + numberRules, + () => { + this.validateKeyValue(this.maskaKeyValue.unmasked) - return this.keyErrors.length === 0 - }, - ] + return this.keyErrors.length === 0 + }, + ] }, errors(): string[] | never[] { @@ -271,12 +271,12 @@ export default defineComponent({ }, focusKeyField({ - key, - altKey, - ctrlKey, - metaKey, - shiftKey, - }: KeyboardEvent): void { + key, + altKey, + ctrlKey, + metaKey, + shiftKey, + }: KeyboardEvent): void { const isSingleField = this.isSingleField const notFilled = !this.maskaNumberValue.completed const keyHasModifier = altKey || ctrlKey || metaKey || shiftKey @@ -354,7 +354,14 @@ export default defineComponent({ numberErrors = [] } " - /> + > + +
{{ numberErrors.join(' ') }}
@@ -385,7 +392,14 @@ export default defineComponent({ keyErrors = [] } " - /> + > + +
{{ keyErrors.join(' ') }}