Fixed #660 - SplitButton: after selecting the default command, the command menu does not close

pull/682/head
Cagatay Civici 2020-11-25 11:34:02 +03:00
parent cc5c452451
commit ee81506e57
1 changed files with 4 additions and 1 deletions

View File

@ -1,6 +1,6 @@
<template>
<div :class="containerClass" :style="style">
<PVSButton type="button" class="p-splitbutton-defaultbutton" v-bind="$attrs" :icon="icon" :label="label" />
<PVSButton type="button" class="p-splitbutton-defaultbutton" v-bind="$attrs" :icon="icon" :label="label" @click="onDefaultButtonClick" />
<PVSButton type="button" class="p-splitbutton-menubutton" icon="pi pi-chevron-down" @click="onDropdownButtonClick" :disabled="$attrs.disabled"
aria-haspopup="true" :aria-controls="ariaId + '_overlay'"/>
<PVSMenu :id="ariaId + '_overlay'" ref="menu" :model="model" :popup="true" :autoZIndex="autoZIndex"
@ -46,6 +46,9 @@ export default {
methods: {
onDropdownButtonClick() {
this.$refs.menu.toggle({currentTarget: this.$el, relativeAlign: this.appendTo == null});
},
onDefaultButtonClick() {
this.$refs.menu.hide();
}
},
computed: {