You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: ion-label does not render when binding innerHTML directly #31433
Verified on 9.0.9. ion-label is a scoped component, so Stencil, the library Ionic components are built with, keeps an internal marker inside the element to track where its content goes. Angular's [innerHTML] binding replaces every child of ion-label, including that marker, and on its next render Stencil hides any content it cannot place, which leaves the label empty. Setting the content later does not avoid it either: it disappears the next time the label re-renders, for example when its color changes. Bypassing Angular's sanitizer, suggested on earlier reports, does not help, since plain text disappears the same way.
Workarounds, both verified on 9.0.9:
Bind innerHTML to an element inside the label instead of the label itself:
For plain text with no markup, bind [textContent]="labelText" on the ion-label.
The fix belongs in Stencil's runtime, so we have reported it upstream in stenciljs/core#6972. We are keeping this issue open to track the fix in Ionic.
Activity
thetaPC commentedon Oct 22, 2026
Thanks for the report, and sorry for the delay.
Verified on 9.0.9.
ion-labelis a scoped component, so Stencil, the library Ionic components are built with, keeps an internal marker inside the element to track where its content goes. Angular's[innerHTML]binding replaces every child ofion-label, including that marker, and on its next render Stencil hides any content it cannot place, which leaves the label empty. Setting the content later does not avoid it either: it disappears the next time the label re-renders, for example when itscolorchanges. Bypassing Angular's sanitizer, suggested on earlier reports, does not help, since plain text disappears the same way.Workarounds, both verified on 9.0.9:
innerHTMLto an element inside the label instead of the label itself:[textContent]="labelText"on theion-label.The fix belongs in Stencil's runtime, so we have reported it upstream in stenciljs/core#6972. We are keeping this issue open to track the fix in Ionic.