Skip to content

Commit

Permalink
fix(color-loupe): hide svg from screen readers (#3318)
Browse files Browse the repository at this point in the history
  • Loading branch information
majornista authored Jun 26, 2023
1 parent 217db8e commit 01e75b7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/color-loupe/src/ColorLoupe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export class ColorLoupe extends SpectrumElement {
protected override render(): TemplateResult {
return html`
<svg
aria-hidden="true"
class="spectrum-ColorLoupe is-open"
overflow="visible"
style="--spectrum-picked-color: ${this
Expand Down
6 changes: 6 additions & 0 deletions packages/color-loupe/test/color-loupe.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,11 @@ describe('ColorLoupe', () => {
await elementUpdated(el);

await expect(el).to.be.accessible();

// SVG should be hidden from screen readers.
expect(el.shadowRoot.querySelector('svg')).to.have.attribute(
'aria-hidden',
'true'
);
});
});

0 comments on commit 01e75b7

Please sign in to comment.