Skip to content

Commit 5a4ff05

Browse files
committed
fix: duplicate hide events, closes #376
1 parent 490600c commit 5a4ff05

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

packages/docs/src/.vuepress/components/DropdownPlacement.vue

+11
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
arrowPadding: 8,
1010
autoHide: false,
1111
}"
12+
@show="log('show')"
13+
@apply-show="log('apply-show')"
14+
@hide="log('hide')"
15+
@apply-hide="log('apply-hide')"
16+
@update:shown="log('update:shown', $event)"
1217
>
1318
<button
1419
class="border border-gray-300 rounded px-4 py-3 text-xl"
@@ -59,5 +64,11 @@ export default {
5964
return list
6065
},
6166
},
67+
68+
methods: {
69+
log (...args) {
70+
console.log(...args)
71+
},
72+
},
6273
}
6374
</script>

packages/docs/src/.vuepress/components/DropdownSimpleExample.vue

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
<template>
22
<div class="example flex justify-center">
3-
<VDropdown>
3+
<VDropdown
4+
@show="log('show')"
5+
@apply-show="log('apply-show')"
6+
@hide="log('hide')"
7+
@apply-hide="log('apply-hide')"
8+
@update:shown="log('update:shown', $event)"
9+
>
410
<button class="border border-gray-300 rounded px-4 py-2">
511
Click me
612
</button>
@@ -13,3 +19,13 @@
1319
</VDropdown>
1420
</div>
1521
</template>
22+
23+
<script>
24+
export default {
25+
methods: {
26+
log (...args) {
27+
console.log(...args)
28+
},
29+
},
30+
}
31+
</script>

packages/floating-vue/src/components/Popper.ts

+1
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,7 @@ export default () => ({
383383
},
384384

385385
hide ({ event = null, skipDelay = false } = {}) {
386+
if (this.$_hideInProgress) return
386387
this.$_scheduleHide(event, skipDelay)
387388

388389
this.$emit('hide')

0 commit comments

Comments
 (0)