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