From 1515e49963a203c079c8e085cf52cf612652b10d Mon Sep 17 00:00:00 2001 From: Matthew Hartstonge Date: Thu, 14 Nov 2024 01:51:51 +1300 Subject: [PATCH] fix(addon/components/paper-button): fixes on click event bubbling. --- addon/components/paper-button.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/addon/components/paper-button.js b/addon/components/paper-button.js index e1c6908d4..15f12206f 100644 --- a/addon/components/paper-button.js +++ b/addon/components/paper-button.js @@ -101,17 +101,19 @@ export default class PaperButton extends Focusable { return this.args.fab || this.args.mini; } + get bubbles() { + return this.args.bubbles === undefined || this.args.bubbles; + } + @action handleClick(e) { if (this.args.onClick) { this.args.onClick(e); } // Prevent bubbling, if specified. If undefined, the event will bubble. - if (this.args.bubbles === undefined) { - return true; + if (!this.bubbles) { + e.stopPropagation(); } - - return this.args.bubbles; } // Proxiable Handlers