Update click outside events to limit only to click events, ignoring blur (#1953)

This commit is contained in:
Mutasem Aldmour
2021-06-30 10:17:30 +03:00
committed by GitHub
parent 38f0cc1a8f
commit a080fab1f1
3 changed files with 15 additions and 9 deletions

View File

@@ -10,7 +10,7 @@
@keydown.esc="onEscape"
ref="input"
size="4"
v-click-outside="onBlur"
v-click-outside="onClickOutside"
/>
</ExpandableInputBase>
</template>
@@ -47,8 +47,10 @@ export default Vue.extend({
onEnter() {
this.$emit('enter', (this.$refs.input as HTMLInputElement).value);
},
onBlur() {
this.$emit('blur', (this.$refs.input as HTMLInputElement).value);
onClickOutside(e: Event) {
if (e.type === 'click') {
this.$emit('blur', (this.$refs.input as HTMLInputElement).value);
}
},
onEscape() {
this.$emit('esc');