angular / angular/components

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

Aperta
#9,529 4 commenti 4 reazioni 0 assegnatari Vedi su GitHub
area: material/icon help wanted P4
Lingua principale
TypeScript
Stelle
25k
Fork
6.8k
Merge medio
1g 8h
PR unite (30g)
91

Descrizione

#### 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).

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia in src/lib/icon/icon-registry.ts, in cloneSvg, e analizza come vengono copiati i defs SVG e i relativi ID. Riproduci il problema con due copie inline contenenti un linearGradient, quindi verifica che ogni copia esegua il rendering del proprio gradiente senza conflitti di ID.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
angular, typescript
Ambito
frontend
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.