Skip to content

Commit 6fc4fba

Browse files
madassdevJhumanJ
andauthored
auto-close datepicker (#512)
* auto-close datepicker * auto close date modification * remove unused attributes --------- Co-authored-by: Julien Nahum <julien@nahum.net>
1 parent edf4d4b commit 6fc4fba

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

client/components/forms/DateInput.vue

+8-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
:max-date="maxDate"
7272
:is-dark="props.isDark"
7373
color="form-color"
74-
@close="close"
74+
@update:modelValue="updateModelValue"
7575
/>
7676
<DatePicker
7777
v-else
@@ -84,7 +84,7 @@
8484
:max-date="maxDate"
8585
:is-dark="props.isDark"
8686
color="form-color"
87-
@close="close"
87+
@update:modelValue="updateModelValue"
8888
/>
8989
</template>
9090
</UPopover>
@@ -143,6 +143,12 @@ const modeledValue = computed({
143143
}
144144
})
145145
146+
const updateModelValue = () => {
147+
if (!props.withTime && !props.dateRange) {
148+
pickerOpen.value = false
149+
}
150+
}
151+
146152
const inputClasses = computed(() => {
147153
const classes = [props.theme.DateInput.input, props.theme.DateInput.borderRadius]
148154
if (props.disabled) {

0 commit comments

Comments
 (0)