Fixed #4065 - SplitButton: aria-expanded not set correctly

pull/3999/head
Tuğçe Küçükoğlu 2023-06-20 10:29:55 +03:00
parent 53308f0904
commit 352ce67e1c
1 changed files with 6 additions and 1 deletions

View File

@ -49,10 +49,15 @@ export default {
isExpanded: false isExpanded: false
}; };
}, },
mounted() {
this.$watch('$refs.menu.visible', (newValue) => {
this.isExpanded = newValue;
});
},
methods: { methods: {
onDropdownButtonClick() { onDropdownButtonClick() {
this.$refs.menu.toggle({ currentTarget: this.$el, relatedTarget: this.$refs.button.$el }); this.$refs.menu.toggle({ currentTarget: this.$el, relatedTarget: this.$refs.button.$el });
this.isExpanded = !this.$refs.menu.visible; this.isExpanded = this.$refs.menu.visible;
}, },
onDropdownKeydown(event) { onDropdownKeydown(event) {
if (event.code === 'ArrowDown' || event.code === 'ArrowUp') { if (event.code === 'ArrowDown' || event.code === 'ArrowUp') {