From b9ca9884067449346004b351011bac34c8209eae Mon Sep 17 00:00:00 2001 From: Daragh King Date: Wed, 12 Feb 2025 15:01:42 +0000 Subject: [PATCH] fix(icon): added img role to svg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit added img role to svg ✅ Closes: COMUI-3359 --- .../src/components/stable/gux-icon/gux-icon.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/genesys-spark-components/src/components/stable/gux-icon/gux-icon.tsx b/packages/genesys-spark-components/src/components/stable/gux-icon/gux-icon.tsx index 2e21052555..1eaed593b3 100644 --- a/packages/genesys-spark-components/src/components/stable/gux-icon/gux-icon.tsx +++ b/packages/genesys-spark-components/src/components/stable/gux-icon/gux-icon.tsx @@ -96,6 +96,8 @@ export class GuxIcon { private getSvgWithAriaAttributes(svgText: string): string { const svgElement = new DOMParser().parseFromString(svgText, 'image/svg+xml') .firstChild as SVGElement; + svgElement.setAttribute('role', 'img'); + if (this.decorative) { svgElement.setAttribute('aria-hidden', String(this.decorative)); } else {