angular / angular/components

mat-icon has display issues when inlining multiple copies of the same SVG with defs with IDs

オープン
#9,529 コメント 4 件 リアクション 4 件 担当者 0 名 GitHub で見る
area: material/icon help wanted P4
主要言語
TypeScript
スター
25k
フォーク
6.8k
平均マージ
1日 8時間
マージ済み PR(30日)
91

説明

#### Bug, feature request, or proposal:
Proposal: Extend the cloneSvg function in src/lib/icon/icon-registry.ts to accommodate munging IDs in defs so that multiple copies of the same inlined SVG won't have conflicting IDs.

#### What is the expected behavior?
When two copies of an SVG with a linearGradient def (identified by an ID) are inlined, both copies of the SVG should display the linear gradient.

#### What is the current behavior?
Only the first copy of the SVG displays the linear gradient. All other copies do not, because the IDs in the defs are duplicated in the other copies.

#### Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular 5.1.2, Angular Material 5.0.2 (although the issue still exists in 5.1.0), TypeScript 2.6.2. Tested in Win10 in Chrome Version 63.0.3239.132 (Official Build) (64-bit).

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

src/lib/icon/icon-registry.ts の cloneSvg から始め、SVG の defs とその ID がどのようにコピーされるかを調べます。linearGradient を含むインライン化されたコピーを 2 つ使って問題を再現し、その後、各コピーが ID の競合なしにグラデーションをレンダリングすることを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
angular, typescript
領域
frontend
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。