Merge pull request #4224 from FVolral/fix/primevue-splitbutton-preventdefault

Fix: Add preventDefault on SplitButton click event
pull/4414/head
Tuğçe Küçükoğlu 2023-09-08 11:50:36 +03:00 committed by GitHub
commit 6cf115d152
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -79,7 +79,8 @@ export default {
}); });
}, },
methods: { methods: {
onDropdownButtonClick() { onDropdownButtonClick(event) {
event.preventDefault();
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;
}, },
@ -90,6 +91,8 @@ export default {
} }
}, },
onDefaultButtonClick(event) { onDefaultButtonClick(event) {
event.preventDefault()
if (this.isExpanded) { if (this.isExpanded) {
this.$refs.menu.hide(event); this.$refs.menu.hide(event);
} }