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

Ouverte
#30,629 0 commentaires 2 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
45/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
À l'abandon
Stack technique
angular, typescript
Domaine
frontend

Piste de recherche

Commencez par la reproduction StackBlitz liée, en particulier src/app/app.component.ts et src/app/foo-ion-content/foo-ion-content.component.html autour des lignes 9 à 11. Comparez le comportement entre Ionic 8.7.0, 8.7.1 et 8.7.2 pour les cas de popover inline, ion-content et sans contenu ; le travail est terminé lorsque l’URL SVG liée s’affiche dans tous les cas documentés.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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

Langage dominant
TypeScript
Étoiles
52.8k
Forks
13.3k
Merge moyen
3 j 1 h
PR mergées (30 j)
78

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de ionic-team/ionic-framework

Toutes les issues de ionic-team/ionic-framework

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.