Skip to content

Commit

Permalink
Propagate event object on KDropdownMenu select
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexVelezLl committed Mar 25, 2024
1 parent 3965306 commit 3ab957b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/KDropdownMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,11 @@
this.closePopover();
}
},
handleSelection(selection) {
handleSelection(selection, $event) {
/**
* Emitted when an option is selected
*/
this.$emit('select', selection);
this.$emit('select', selection, $event);
this.closePopover();
},
closePopover() {
Expand Down
8 changes: 4 additions & 4 deletions lib/keen/UiMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
:target="option[keys.target]"

:type="option[keys.type]"
@click.native="selectOption(option)"
@keydown.enter.native="selectOption(option)"
@click.native="($event) => selectOption(option, $event)"
@keydown.enter.native="($event) => selectOption(option, $event)"

@keydown.esc.native.esc="closeMenu"
:style="[ activeOutline ]"
Expand Down Expand Up @@ -107,12 +107,12 @@
},
methods: {
selectOption(option) {
selectOption(option, $event) {
if (option.disabled || option.type === 'divider') {
return;
}
this.$emit('select', option);
this.$emit('select', option, $event);
this.closeMenu();
},
closeMenu() {
Expand Down

0 comments on commit 3ab957b

Please sign in to comment.