Skip to content

Commit

Permalink
fix(addon/components/paper-button): fixes on click event bubbling.
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewhartstonge committed Nov 14, 2024
1 parent fd61160 commit 1515e49
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions addon/components/paper-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1515e49

Please sign in to comment.