Skip to content

Commit

Permalink
fix(button): added event emited for type of click
Browse files Browse the repository at this point in the history
  • Loading branch information
WillianLomeu committed May 27, 2024
1 parent 04e20a9 commit e58e74f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/button/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,10 @@ export class Button {

private handleClick = (ev) => {
if (!this.disabled) {
this.bdsClick.emit(ev);

if (ev.key === 'Enter') {
if (ev.key == 'Enter') {
this.bdsClick.emit(ev);
}
if (ev.type == 'click') {
this.bdsClick.emit(ev);
}

Expand All @@ -189,6 +190,7 @@ export class Button {
<button
onClick={(ev) => this.handleClick(ev)}
disabled={this.disabled}
tabindex="-1"
aria-disabled={this.disabled ? 'true' : 'false'}
aria-live="assertive"
type={this.type}
Expand Down

0 comments on commit e58e74f

Please sign in to comment.