From 8ef984894d765e5caf8deb8063f170c949d2f9fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Volral?= Date: Mon, 31 Jul 2023 14:54:09 +0200 Subject: [PATCH] Fix: Add preventDefault on SplitButton click event The SplitButton component of PrimeVue was missing a preventDefault() call when clicking on the button that opens the dropdown menu. This caused unexpected behavior when interacting with the dropdown menu. The issue has been resolved by adding the preventDefault() on the click event, ensuring smooth and expected functionality. Fixes #4223" --- components/lib/splitbutton/SplitButton.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/lib/splitbutton/SplitButton.vue b/components/lib/splitbutton/SplitButton.vue index c67e3187a..591e9859a 100755 --- a/components/lib/splitbutton/SplitButton.vue +++ b/components/lib/splitbutton/SplitButton.vue @@ -56,7 +56,8 @@ export default { }); }, methods: { - onDropdownButtonClick() { + onDropdownButtonClick(event) { + event.preventDefault(); this.$refs.menu.toggle({ currentTarget: this.$el, relatedTarget: this.$refs.button.$el }); this.isExpanded = this.$refs.menu.visible; }, @@ -67,6 +68,8 @@ export default { } }, onDefaultButtonClick(event) { + event.preventDefault() + if (this.isExpanded) { this.$refs.menu.hide(event); }