From 98975ec0f54b825c33f528683834a5e38298d598 Mon Sep 17 00:00:00 2001 From: Amanda Johnston <90629384+amandaejohnston@users.noreply.github.com> Date: Fri, 20 Jan 2023 10:18:28 -0600 Subject: [PATCH 1/4] fix(icon): remove auto-generated aria-label (#1170) --- src/components/icon/icon.tsx | 27 +----------- src/components/icon/test/icon.spec.ts | 59 --------------------------- 2 files changed, 2 insertions(+), 84 deletions(-) diff --git a/src/components/icon/icon.tsx b/src/components/icon/icon.tsx index 7020d21f..99bb2a4b 100755 --- a/src/components/icon/icon.tsx +++ b/src/components/icon/icon.tsx @@ -19,7 +19,6 @@ export class Icon { @State() private svgContent?: string; @State() private isVisible = false; - @State() private ariaLabel?: string; /** * The mode determines which platform styles to use. @@ -124,12 +123,6 @@ export class Icon { cb(); } } - - private hasAriaHidden = () => { - const { el } = this; - - return el.hasAttribute('aria-hidden') && el.getAttribute('aria-hidden') === 'true'; - } @Watch('name') @Watch('src') @@ -164,19 +157,11 @@ 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 || @@ -184,16 +169,8 @@ export class Icon { (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(` - - -
-
-
- `); - }); }); From 2ffcb6a012571915cf54c511cd41f75881b755e9 Mon Sep 17 00:00:00 2001 From: ionitron Date: Tue, 7 Mar 2023 13:49:46 +0000 Subject: [PATCH 2/4] v7.0.0 --- CHANGELOG.md | 22 ++++++++++++++++++++++ lerna.json | 2 +- package-lock.json | 13 ++++++++----- package.json | 2 +- 4 files changed, 32 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d22eda7..e40e3530 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,28 @@ 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) + + +### 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)) + + + + + +# [7.0.0](https://github.com/ionic-team/ionicons/compare/v6.1.3...v7.0.0) (2023-03-07) + + +### 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..cb24738b 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" @@ -19249,7 +19249,8 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz", "integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==", - "dev": true + "dev": true, + "requires": {} }, "@octokit/plugin-rest-endpoint-methods": { "version": "6.7.0", @@ -24102,7 +24103,8 @@ "version": "1.2.2", "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz", "integrity": "sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w==", - "dev": true + "dev": true, + "requires": {} }, "jest-regex-util": { "version": "26.0.0", @@ -29288,7 +29290,8 @@ "version": "7.4.6", "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", - "dev": true + "dev": true, + "requires": {} }, "xml-name-validator": { "version": "3.0.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/", From ac450cbd2872e69f3097f37c9c431432d9c46663 Mon Sep 17 00:00:00 2001 From: ionitron Date: Tue, 7 Mar 2023 13:49:51 +0000 Subject: [PATCH 3/4] chore(): update package lock files --- package-lock.json | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index cb24738b..7c0e6e2a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19249,8 +19249,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz", "integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==", - "dev": true, - "requires": {} + "dev": true }, "@octokit/plugin-rest-endpoint-methods": { "version": "6.7.0", @@ -24103,8 +24102,7 @@ "version": "1.2.2", "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz", "integrity": "sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w==", - "dev": true, - "requires": {} + "dev": true }, "jest-regex-util": { "version": "26.0.0", @@ -29290,8 +29288,7 @@ "version": "7.4.6", "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", - "dev": true, - "requires": {} + "dev": true }, "xml-name-validator": { "version": "3.0.0", From 63788874dbd7a2d1105b1bc7515952cf9decda03 Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Tue, 7 Mar 2023 08:51:36 -0500 Subject: [PATCH 4/4] chore(): add migration note --- CHANGELOG.md | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e40e3530..b084c694 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline # [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 @@ -13,18 +14,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline - -# [7.0.0](https://github.com/ionic-team/ionicons/compare/v6.1.3...v7.0.0) (2023-03-07) - - -### 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)