fix(icon): single pronounciation in JAWS/FF
This commit is contained in:
parent
51732b0e4f
commit
978af941ba
4 changed files with 15 additions and 2 deletions
5
.changeset/large-dodos-notice.md
Normal file
5
.changeset/large-dodos-notice.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@lion/icon': minor
|
||||
---
|
||||
|
||||
fix(icon): single pronounciation in JAWS/FF
|
||||
|
|
@ -73,8 +73,8 @@ export const iconSets = () => html`
|
|||
font-size: 10px;
|
||||
}
|
||||
</style>
|
||||
<div class="demo-icon__container" title="lion:space:${name}">
|
||||
<lion-icon icon-id="lion:space:${name}" aria-label="icon: ${name}"></lion-icon>
|
||||
<div class="demo-icon__container">
|
||||
<lion-icon icon-id="lion:space:${name}" aria-label="${name}"></lion-icon>
|
||||
<span class="demo-icon__name">${name}</span>
|
||||
</div>
|
||||
`,
|
||||
|
|
|
|||
|
|
@ -145,6 +145,9 @@ export class LionIcon extends LitElement {
|
|||
_renderSvg(svgObject) {
|
||||
validateSvg(svgObject);
|
||||
render(svgObject, this);
|
||||
if (this.firstElementChild) {
|
||||
this.firstElementChild.setAttribute('aria-hidden', 'true');
|
||||
}
|
||||
}
|
||||
|
||||
async _onIconIdChanged(prevIconId) {
|
||||
|
|
|
|||
|
|
@ -61,6 +61,11 @@ describe('lion-icon', () => {
|
|||
await expect(el).to.be.accessible();
|
||||
});
|
||||
|
||||
it('expect the svg icon to be aria-hidden', async () => {
|
||||
const icon = await fixture(html`<lion-icon .svg=${heartSvg} aria-label="Love"></lion-icon>`);
|
||||
expect(icon.children[0].getAttribute('aria-hidden')).to.equal('true');
|
||||
});
|
||||
|
||||
it('expects svg-icons to have the attribute `focusable="false"` so the icon doesn\'t appear in tab-order in IE/Edge', async () => {
|
||||
const icon = await fixture(html`<lion-icon .svg=${heartSvg} aria-label="Love"></lion-icon>`);
|
||||
expect(icon.children[0].getAttribute('focusable')).to.equal('false');
|
||||
|
|
|
|||
Loading…
Reference in a new issue