auto-close datepicker (#512)

* auto-close datepicker

* auto close date modification

* remove unused attributes

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
This commit is contained in:
Favour Olayinka 2024-08-05 13:22:05 +01:00 committed by GitHub
parent edf4d4bfe4
commit 6fc4fbafa3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 2 deletions

View File

@ -71,7 +71,7 @@
:max-date="maxDate"
:is-dark="props.isDark"
color="form-color"
@close="close"
@update:modelValue="updateModelValue"
/>
<DatePicker
v-else
@ -84,7 +84,7 @@
:max-date="maxDate"
:is-dark="props.isDark"
color="form-color"
@close="close"
@update:modelValue="updateModelValue"
/>
</template>
</UPopover>
@ -143,6 +143,12 @@ const modeledValue = computed({
}
})
const updateModelValue = () => {
if (!props.withTime && !props.dateRange) {
pickerOpen.value = false
}
}
const inputClasses = computed(() => {
const classes = [props.theme.DateInput.input, props.theme.DateInput.borderRadius]
if (props.disabled) {