angular / angular/components

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

未关闭
#9,529 4 条评论 4 个 reaction 已指派 0 人 在 GitHub 查看
area: material/icon help wanted P4
主要语言
TypeScript
星标
25k
派生
6.8k
平均合并
1 天 8 小时
30 天内合并 PR
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 的内联副本重现该问题,然后验证每个副本都能在没有 ID 冲突的情况下渲染其渐变。

由索引模型根据 Issue 内容生成。

评估

技术栈
angular, typescript
领域
frontend
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
描述清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。