Skip to content

Commit

Permalink
feat: added alt text on aria-label of svg for a11y
Browse files Browse the repository at this point in the history
  • Loading branch information
pplancq committed Jun 5, 2024
1 parent b130b98 commit 6c128ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/svg-react/src/Svg.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ export const Svg = ({ src, alt, ...props }: SvgProps) => {
return alt ? <span>{alt}</span> : null;
}

return <svg {...props} ref={svgRef} />;
return <svg {...props} ref={svgRef} aria-label={alt || props['aria-label']} />;
};

0 comments on commit 6c128ff

Please sign in to comment.