2
0
mirror of https://github.com/frappe/books.git synced 2024-12-23 11:29:03 +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>
<Popover @open="selectCurrentMonthYear">
<template v-slot:target="{ togglePopover }">
<template v-slot:target="{ togglePopover, handleBlur }">
<input
type="text"
:class="inputClass"
@ -8,7 +8,7 @@
:placeholder="placeholder"
readonly
@focus="!readonly ? togglePopover() : null"
@blur="togglePopover(false)"
@blur="handleBlur"
/>
</template>
<template v-slot:content="{ togglePopover }">

View File

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