Skip to content

Commit

Permalink
Fixed #5828 - ContextMenu:there are no emitters before-show and befor…
Browse files Browse the repository at this point in the history
…e-hide
  • Loading branch information
tugcekucukoglu committed Jun 7, 2024
1 parent 78b9416 commit 5fdba8c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/lib/contextmenu/ContextMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default {
name: 'ContextMenu',
extends: BaseContextMenu,
inheritAttrs: false,
emits: ['focus', 'blur', 'show', 'hide'],
emits: ['focus', 'blur', 'show', 'hide', 'before-hide', 'before-show'],
target: null,
outsideClickListener: null,
resizeListener: null,
Expand Down Expand Up @@ -125,6 +125,7 @@ export default {
this.visible ? this.hide() : this.show(event);
},
show(event) {
this.$emit('before-show');
this.activeItemPath = [];
this.focusedItemInfo = { index: -1, level: 0, parentKey: '' };
DomHandler.focus(this.list);
Expand All @@ -137,6 +138,7 @@ export default {
event.preventDefault();
},
hide() {
this.$emit('before-hide');
this.visible = false;
this.activeItemPath = [];
this.focusedItemInfo = { index: -1, level: 0, parentKey: '' };
Expand Down

0 comments on commit 5fdba8c

Please sign in to comment.