Skip to content

Commit

Permalink
Fixed #710 - SplitButton: after selecting the default command, the co…
Browse files Browse the repository at this point in the history
…mmand menu does not close
  • Loading branch information
cagataycivici committed Nov 27, 2020
1 parent d6a8378 commit 7e85054
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/splitbutton/SplitButton.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="p-splitbutton p-component">
<PVSButton type="button" class="p-splitbutton-defaultbutton" :icon="icon" :label="label" @click="onClick" :disabled="disabled" :tabindex="tabindex" />
<PVSButton type="button" class="p-splitbutton-defaultbutton" :icon="icon" :label="label" @click="onDefaultButtonClick" :disabled="disabled" :tabindex="tabindex" />
<PVSButton type="button" class="p-splitbutton-menubutton" icon="pi pi-chevron-down" @click="onDropdownButtonClick" :disabled="disabled"
aria-haspopup="true" :aria-controls="ariaId + '_overlay'"/>
<PVSMenu :id="ariaId + '_overlay'" ref="menu" :model="model" :popup="true" :autoZIndex="autoZIndex"
Expand Down Expand Up @@ -49,8 +49,9 @@ export default {
}
},
methods: {
onClick(event) {
onDefaultButtonClick(event) {
this.$emit('click', event);
this.$refs.menu.hide();
},
onDropdownButtonClick() {
this.$refs.menu.toggle({currentTarget: this.$el, relativeAlign: this.appendTo == null});
Expand Down

0 comments on commit 7e85054

Please sign in to comment.