Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow aria-hidden argument #264

Merged
merged 1 commit into from
Jan 31, 2024
Merged

Conversation

chancancode
Copy link
Contributor

This is already supported and tested:

test('it allows to set a11y SVG attributes for decorative images', async function (assert) {
await render(
hbs`{{svg-jar "icon" role="presentation" data-test-id="one"}}`
);
assert.dom('[data-test-id="one"]').hasAttribute('role', 'presentation');
await render(hbs`{{svg-jar "icon" role="none" data-test-id="two"}}`);
assert.dom('[data-test-id="two"]').hasAttribute('role', 'none');
await render(
hbs`{{svg-jar "icon" aria-hidden="true" data-test-id="three"}}`
);
assert.dom('[data-test-id="three"]').hasAttribute('aria-hidden', 'true');
});

It is considered a best practice to use aria-hidden on decorative SVGs: https://www.unimelb.edu.au/accessibility/techniques/accessible-svgs

@evoactivity
Copy link
Owner

embroider optimized is expected to fail at the moment.

I'll cut a release tomorrow morning.

@evoactivity evoactivity merged commit 1bd359e into evoactivity:master Jan 31, 2024
14 of 15 checks passed
evoactivity added a commit that referenced this pull request Feb 2, 2024
* 'master' of https://github.com/ghedamat/ember-svg-jar:
  Allow `aria-hidden` argument (#264)
  Add helper types and imports documentation (#260)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants