From dfda75a31a1ba5c71b4f94ae35f33ed845f09431 Mon Sep 17 00:00:00 2001 From: virginieVachet Date: Fri, 15 Nov 2024 10:28:02 +0100 Subject: [PATCH] fix error display on submit in datePicker --- .../src/patterns/DatePicker/DatePicker.vue | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/synapse-bridge/src/patterns/DatePicker/DatePicker.vue b/packages/synapse-bridge/src/patterns/DatePicker/DatePicker.vue index ba04acac5..4f4d5c564 100644 --- a/packages/synapse-bridge/src/patterns/DatePicker/DatePicker.vue +++ b/packages/synapse-bridge/src/patterns/DatePicker/DatePicker.vue @@ -246,6 +246,15 @@ export default defineComponent({ this.validateWarning(this.internalValue) await this.$nextTick() this.errorMessages = await textField.validate() + + const messagesElement = this.$el.querySelector('.v-messages'); + if (messagesElement) { + if (!this.errorMessages?.length) { + this.$el.classList.add('hide-messages'); + } else { + this.$el.classList.remove('hide-messages'); + } + } }, handleTextInput(date: string, updateCalendar: (s: string) => void) { if (date === '') { @@ -282,7 +291,7 @@ export default defineComponent({