Skip to content

bug: ion-label adds an empty comment as its first child, breaking SolidJS integration #29756

@spion

Description

@spion

Prerequisites

Ionic Framework Version

v8.x

Current Behavior

ion-label seems to add an empty HTML comment (which results with a DOM comment element). This breaks libraries such as SolidJS which make assumptions to optimize the updates when there is a single string child inside a component.

Arguably, this could be considered a SolidJS bug (ryansolid/dom-expressions#337) but the behavior is still strange.

Expected Behavior

ion-label should not produce empty comment nodes

Steps to Reproduce

Repro with SolidJS

Repro without SolidJS - using inspect element you can see that IonLabel's firstChild is not the text node, but a strange empty comment node, and that's why the timer fails to update the content and updates the comment instead.

Code Reproduction URL

https://stackblitz.com/edit/github-pyx5ga-pmauak?file=index.html

Ionic Info

N/A (stackblitz example should be sufficient)

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions