bug: ion-icon [src] binding for string value regression after stencil upgrade

Offen
#30,629 0 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
45/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
angular, typescript
Bereich
frontend

Rechercherichtung

Beginne mit der verlinkten StackBlitz-Reproduktion, insbesondere mit src/app/app.component.ts und src/app/foo-ion-content/foo-ion-content.component.html bei den Zeilen 9–11. Vergleiche das Verhalten zwischen Ionic 8.7.0, 8.7.1 und 8.7.2 für Inline-, ion-content- und Popover-Fälle ohne Inhalt; abgeschlossen ist die Aufgabe, wenn die gebundene SVG-URL in allen dokumentierten Fällen gerendert wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

stencil type: bug
Prerequisites
Ionic Framework Version

v8.x

Current Behavior

ion-icon using the [src] binding with string value inside a popover without ion-content stopped rendering.

Notes:
I know [src]="'value'" is redundant compared to src="value", but it worked fine before the update.

This seems to be a regression since the same Angular + Ionic code works perfectly in 8.7.0 but breaks in 8.7.1.

While ion-content is recommended, I don’t think it’s strictly required, and this issue might reveal another underlying bug.

Example of broken code:

<ion-icon
  [src]="'https://ionicframework.com/docs/logos/ionic-text-docs-dark.svg'">
</ion-icon>

Example that works:

<ion-icon
  src="https://ionicframework.com/docs/logos/ionic-text-docs-dark.svg"
  size="large">
</ion-icon>
Expected Behavior

ion-icon src should be rendered as before, regarding if string value (url) will be provided using [src]="''" or src=""

Steps to Reproduce
  1. Create a component containing an ion-icon with a custom [src] binding pointing to valid svg url
  2. ✅ Display the component inline → works.
  3. ✅ Display the component inside a popover with ion-content → works.
  4. ❌ Display the component inside a popover without ion-content → icon does not render.

Reproduction repo:
StackBlitz reproduction

Code Reproduction URL

https://stackblitz.com/~/github.com/andrzejpindor/ionic-icon-bindings-regression-repro?file=src/app/foo-ion-content/foo-ion-content.component.html:L9-L11

Ionic Info
Ionic:

   Ionic CLI                     : 7.2.1 
   Ionic Framework               : @ionic/angular 8.7.2
   @angular-devkit/build-angular : 19.2.15
   @angular-devkit/schematics    : 19.2.15
   @angular/cli                  : 19.2.15
   @ionic/angular-toolkit        : 12.3.0

Utility:

   cordova-res : 0.15.4
   native-run  : 2.0.1

System:

   NodeJS : v20.15.1 (/Users/andrzejpindor/.local/share/nvm/v20.15.1/bin/node)
   npm    : 10.7.0
   OS     : macOS Unknown
Additional Information

No response

Vorherrschende Sprache
TypeScript
Sterne
52.8k
Forks
13.3k
Ø Merge
3 T. 1 Std.
Gemergte PRs (30 T.)
78

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus ionic-team/ionic-framework

Alle Issues in ionic-team/ionic-framework

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.