Skip to content

Commit

Permalink
fix(number-field): added aria-hidden attribute for inc/dec buttons (#…
Browse files Browse the repository at this point in the history
…4933)

* fix(number-field): added aira-hidden attribute for inc/dec buttons

* chore(number-field): removed a test

* chore(number-field): added  tests
  • Loading branch information
blunteshwar authored Nov 20, 2024
1 parent bb53e32 commit b16a839
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/number-field/src/NumberField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ export class NumberField extends TextfieldBase {
inline="end"
block="start"
class="button step-up"
aria-describedby=${this.helpTextId}
aria-hidden="true"
label=${'Increase ' + this.appliedLabel}
size=${this.size}
tabindex="-1"
Expand All @@ -764,7 +764,7 @@ export class NumberField extends TextfieldBase {
inline="end"
block="end"
class="button step-down"
aria-describedby=${this.helpTextId}
aria-hidden="true"
label=${'Decrease ' + this.appliedLabel}
size=${this.size}
tabindex="-1"
Expand Down
6 changes: 3 additions & 3 deletions packages/number-field/test/number-field.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1753,7 +1753,7 @@ describe('NumberField', () => {
});
});
describe('accessibility model', () => {
it('buttons have proper label', async () => {
it('increment and decrement buttons cannot receive keyboard focus', async () => {
await fixture<HTMLDivElement>(html`
<div>
${Default({
Expand All @@ -1777,15 +1777,15 @@ describe('NumberField', () => {
(node) => node.name === 'Increase Enter a number'
),
'`name` is the label text'
).to.not.be.null;
).to.be.null;

expect(
findAccessibilityNode<NamedNode>(
snapshot,
(node) => node.name === 'Decrease Enter a number'
),
'`name` is the label text'
).to.not.be.null;
).to.be.null;
});
});
});

0 comments on commit b16a839

Please sign in to comment.