Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

fix(webv2): stop double-announcing brand icons beside visible text

joshistoaste59c77376a1c
diff --git a/invokeai/frontend/webv2/src/platform/ui/BrandIcon.tsx b/invokeai/frontend/webv2/src/platform/ui/BrandIcon.tsx
index 9941606d44..8f95b0e0ce 100644
--- a/invokeai/frontend/webv2/src/platform/ui/BrandIcon.tsx
+++ b/invokeai/frontend/webv2/src/platform/ui/BrandIcon.tsx
@@ -24,17 +24,21 @@ interface BrandIconSource {
}
const createBrandIcon = ({ path, title }: BrandIconSource) => {
- const BrandIcon = (props: SVGProps<SVGSVGElement>) => (
+ const BrandIcon = ({ titleAccess, ...props }: SVGProps<SVGSVGElement> & { titleAccess?: boolean }) => (
<svg
+ // Decorative by default: every current consumer pairs the mark with
+ // visible text, and a titled icon there is announced twice. Pass
+ // `titleAccess` when the icon stands alone.
+ aria-hidden={titleAccess ? undefined : true}
fill="currentColor"
height="1em"
- role="img"
+ role={titleAccess ? 'img' : undefined}
viewBox="0 0 24 24"
width="1em"
xmlns="http://www.w3.org/2000/svg"
{...props}
>
- <title>{title}</title>
+ {titleAccess ? <title>{title}</title> : null}
<path d={path} />
</svg>
);