diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d22eda7..b084c694 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [7.0.0](https://github.com/ionic-team/ionicons/compare/v6.1.3...v7.0.0) (2023-03-07) + +**Migration Note:** Developers should ensure that their `` usages have either `aria-label` or `aria-hidden` to avoid accessibility issues. See https://ionic.io/ionicons/usage for more information. + +### Bug Fixes + +* **icon:** remove auto-generated aria-label ([#1170](https://github.com/ionic-team/ionicons/issues/1170)) ([98975ec](https://github.com/ionic-team/ionicons/commit/98975ec0f54b825c33f528683834a5e38298d598)) + + + + ## [6.1.3](https://github.com/ionic-team/ionicons/compare/v6.1.2...v6.1.3) (2023-02-09) diff --git a/lerna.json b/lerna.json index b5c8e20f..13dd0f07 100644 --- a/lerna.json +++ b/lerna.json @@ -2,5 +2,5 @@ "packages": [ "./" ], - "version": "6.1.3" + "version": "7.0.0" } diff --git a/package-lock.json b/package-lock.json index be853d71..7c0e6e2a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ionicons", - "version": "6.1.3", + "version": "7.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ionicons", - "version": "6.1.3", + "version": "7.0.0", "license": "MIT", "dependencies": { "@stencil/core": "^2.18.0" diff --git a/package.json b/package.json index 8e880447..a58e6b2f 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ionicons", - "version": "6.1.3", + "version": "7.0.0", "description": "Premium icons for Ionic.", "files": [ "components/", diff --git a/src/components/icon/icon.tsx b/src/components/icon/icon.tsx index 68657680..ddf954d7 100755 --- a/src/components/icon/icon.tsx +++ b/src/components/icon/icon.tsx @@ -17,7 +17,6 @@ export class Icon { @State() private svgContent?: string; @State() private isVisible = false; - @State() private ariaLabel?: string; /** * The mode determines which platform styles to use. @@ -123,12 +122,6 @@ export class Icon { } } - private hasAriaHidden = () => { - const { el } = this; - - return el.hasAttribute('aria-hidden') && el.getAttribute('aria-hidden') === 'true'; - }; - @Watch('name') @Watch('src') @Watch('icon') @@ -149,34 +142,18 @@ export class Icon { } } - const label = (this.iconName = getName(this.name, this.icon, this.mode, this.ios, this.md)); - - /** - * Come up with a default label - * in case user does not provide their own. - */ - if (label) { - this.ariaLabel = label.replace(/\-/g, ' '); - } + this.iconName = getName(this.name, this.icon, this.mode, this.ios, this.md); } render() { - const { iconName, ariaLabel, el, inheritedAttributes } = this; + const { iconName, el, inheritedAttributes } = this; const mode = this.mode || 'md'; const flipRtl = this.flipRtl || (iconName && (iconName.indexOf('arrow') > -1 || iconName.indexOf('chevron') > -1) && this.flipRtl !== false); - /** - * Only set the aria-label if a) we have generated - * one for the icon and if aria-hidden is not set to "true". - * If developer wants to set their own aria-label, then - * inheritedAttributes down below will override whatever - * default label we have set. - */ return ( { `); }); - it('renders aria-hidden and no aria-label', async () => { - const { root } = await newSpecPage({ - components: [Icon], - html: ``, - }); - expect(root).toEqualHtml(` - - `); - }); - it('renders rtl with aria-hidden', async () => { const { root } = await newSpecPage({ components: [Icon], @@ -46,21 +32,6 @@ describe('icon', () => { `); }); - it('renders default aria-label', async () => { - const { root } = await newSpecPage({ - components: [Icon], - html: ``, - }); - - expect(root).toEqualHtml(` - - -
-
-
- `); - }); - it('renders custom aria-label', async () => { const { root } = await newSpecPage({ components: [Icon], @@ -105,34 +76,4 @@ describe('icon', () => {
`); }); - - it('renders default label after changing source', async () => { - const page = await newSpecPage({ - components: [Icon], - html: ``, - }); - - const icon = page.root; - - expect(icon).toEqualHtml(` - - -
-
-
- `); - - if (icon) { - icon.name = 'trash'; - } - await page.waitForChanges(); - - expect(icon).toEqualHtml(` - - -
-
-
- `); - }); });