Skip to content

Commit

Permalink
fix: duplicate hide events, closes #376
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Mar 11, 2022
1 parent 490600c commit 5a4ff05
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
11 changes: 11 additions & 0 deletions packages/docs/src/.vuepress/components/DropdownPlacement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
arrowPadding: 8,
autoHide: false,
}"
@show="log('show')"
@apply-show="log('apply-show')"
@hide="log('hide')"
@apply-hide="log('apply-hide')"
@update:shown="log('update:shown', $event)"
>
<button
class="border border-gray-300 rounded px-4 py-3 text-xl"
Expand Down Expand Up @@ -59,5 +64,11 @@ export default {
return list
},
},
methods: {
log (...args) {
console.log(...args)
},
},
}
</script>
18 changes: 17 additions & 1 deletion packages/docs/src/.vuepress/components/DropdownSimpleExample.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<template>
<div class="example flex justify-center">
<VDropdown>
<VDropdown
@show="log('show')"
@apply-show="log('apply-show')"
@hide="log('hide')"
@apply-hide="log('apply-hide')"
@update:shown="log('update:shown', $event)"
>
<button class="border border-gray-300 rounded px-4 py-2">
Click me
</button>
Expand All @@ -13,3 +19,13 @@
</VDropdown>
</div>
</template>

<script>
export default {
methods: {
log (...args) {
console.log(...args)
},
},
}
</script>
1 change: 1 addition & 0 deletions packages/floating-vue/src/components/Popper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ export default () => ({
},

hide ({ event = null, skipDelay = false } = {}) {
if (this.$_hideInProgress) return
this.$_scheduleHide(event, skipDelay)

this.$emit('hide')
Expand Down

0 comments on commit 5a4ff05

Please sign in to comment.