Skip to content

Commit

Permalink
fix(svg symbols): fixes missing title IDs
Browse files Browse the repository at this point in the history
affects: @buildit/gravity-ui-web

Fixes a bug in our build process that caused the IDs for SVG symbols' <title> elements to be
omitted. This cuased an a11y issue because those IDs are needed in order for inlined instances of
those SVGs on a page to have text alternatives.

ISSUES CLOSED: #369
  • Loading branch information
James Nash committed Dec 6, 2019
1 parent d3010b7 commit 256a828
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/gravity-ui-web/gulp/ui-lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ function svgSymbolsTask() {
// Add an ID to the <title> element of each SVG symbol
// This is so that we can later reference it via
// aria-labelledby for better a11y.
$('symbol').each(() => {
const symbol = $(this);
$('symbol').each((index, element) => {
const symbol = $(element);
const symbolId = symbol.attr('id');
const title = symbol.children('title');
title.attr('id', symbolId + titleIdSuffix);
Expand Down

0 comments on commit 256a828

Please sign in to comment.