Skip to content

Commit

Permalink
fix error display on submit in datePicker
Browse files Browse the repository at this point in the history
  • Loading branch information
VachetVirginie committed Nov 15, 2024
1 parent ef02f28 commit dfda75a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/synapse-bridge/src/patterns/DatePicker/DatePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 === '') {
Expand Down Expand Up @@ -282,7 +291,7 @@ export default defineComponent({
</script>

<template>
<div class="vd-date-picker" :class="{ 'hide-messages': hasWarningMessages }" id="toto">
<div class="vd-date-picker" :class="{ 'hide-messages': hasWarningMessages }">
<VueDatePicker
v-model="calendarValue"
ref="calendar"
Expand Down

0 comments on commit dfda75a

Please sign in to comment.