Skip to content

Commit

Permalink
fix: add disabled link option (#1430)
Browse files Browse the repository at this point in the history
* fix: add disabled link option
  • Loading branch information
felix-ico authored Mar 21, 2023
1 parent bd60e57 commit 0128a9e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/components/src/components/button/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,14 @@ export class Button {
<a
ref={(el) => (this.focusableElement = el)}
class={this.getCssClassMap()}
href={this.href}
href={this.disabled ? null : this.href}
download={this.download}
target={this.target}
rel={this.target === '_blank' ? 'noopener noreferrer' : undefined}
part={basePart}
tabIndex={this.innerTabindex}
role="link"
aria-disabled={this.disabled ? 'true' : null}
aria-label={this.innerAriaLabel}
>
<slot />
Expand Down Expand Up @@ -242,7 +244,7 @@ export class Button {
!this.iconOnly &&
this.iconPosition &&
`button--icon-${this.iconPosition}`,
this.disabled && !this.href && `button--disabled`
this.disabled && `button--disabled`
);
}
}

0 comments on commit 0128a9e

Please sign in to comment.