Skip to content

Commit

Permalink
feat(stepper): add aria-* attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
mseyfayi authored and majidsajadi committed May 13, 2024
1 parent 32cbe29 commit ce779e0
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/stepper/stepper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export class Stepper extends LitElement {
type="button"
part="decrease-button"
variant="ghost"
tabindex="-1"
@click=${this.handleDecrease}
?disabled=${this.disabled || this.value <= this.min}
>
Expand All @@ -40,13 +41,22 @@ export class Stepper extends LitElement {
.height=${iconSize}
></tap-icon-minus>
</tap-icon-button>
<p part="value">${this.value}</p>
${this.unit ? html`<p part="unit">${this.unit}</p>` : nothing}
<dev
tabindex="0"
role="spinbutton"
aria-valuenow=${this.value}
aria-valuemax=${this.max}
aria-valuemin=${this.min}
>
<span part="value">${this.value}</span>
${this.unit ? html`<span part="unit">${this.unit}</span>` : nothing}
</dev>
<tap-icon-button
.size=${this.size}
type="button"
part="increase-button"
variant="ghost"
tabindex="-1"
@click=${this.handleIncrease}
?disabled=${this.disabled || this.value >= this.max}
>
Expand Down

0 comments on commit ce779e0

Please sign in to comment.