2
0
mirror of https://github.com/frappe/books.git synced 2025-01-11 02:36:14 +00:00

fix: DatePicker toggle on tab, allow click

This commit is contained in:
18alantom 2022-01-12 13:28:33 +05:30
parent f128ad6f57
commit c8d2edd188
2 changed files with 10 additions and 3 deletions

View File

@ -1,6 +1,6 @@
<template> <template>
<Popover @open="selectCurrentMonthYear"> <Popover @open="selectCurrentMonthYear">
<template v-slot:target="{ togglePopover }"> <template v-slot:target="{ togglePopover, handleBlur }">
<input <input
type="text" type="text"
:class="inputClass" :class="inputClass"
@ -8,7 +8,7 @@
:placeholder="placeholder" :placeholder="placeholder"
readonly readonly
@focus="!readonly ? togglePopover() : null" @focus="!readonly ? togglePopover() : null"
@blur="togglePopover(false)" @blur="handleBlur"
/> />
</template> </template>
<template v-slot:content="{ togglePopover }"> <template v-slot:content="{ togglePopover }">

View File

@ -1,7 +1,11 @@
<template> <template>
<div ref="reference"> <div ref="reference">
<div class="h-full"> <div class="h-full">
<slot name="target" :togglePopover="togglePopover"></slot> <slot
name="target"
:togglePopover="togglePopover"
:handleBlur="handleBlur"
></slot>
</div> </div>
<div <div
ref="popover" ref="popover"
@ -125,6 +129,9 @@ export default {
this.isOpen = false; this.isOpen = false;
this.$emit('close'); this.$emit('close');
}, },
handleBlur({ relatedTarget }) {
relatedTarget && this.close();
},
}, },
}; };
</script> </script>