Repository navigation
fix(runtime): patch innerHTML and innerText setters on scoped components - #6997
Merged
Merged
Conversation
1 of 2 tasks
ShaneK
pushed a commit
to masimplo/ionic-framework
that referenced
this pull request
Nov 12, 2026
Issue number: resolves ionic-team#31433 --------- ## What is the current behavior? Ionic uses `@stencil/core` 4.45.2. On scoped components, setting `innerHTML` or `innerText` removes a marker node Stencil uses to track slotted content, so the content is hidden on the next render. ## What is the new behavior? - Updates `@stencil/core` to 4.45.3, which patches the `innerHTML` and `innerText` setters on scoped components (stenciljs/core#6997). ## Does this introduce a breaking change? - [ ] Yes - [x] No ## Other information Regression tests for `ion-label` are added in ionic-team#31739, which is stacked on this PR. Co-authored-by: Brandy Smith <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the current behavior?
With
experimentalSlotFixes, settinginnerHTMLorinnerTexton a scoped component that has a slot replaces every host child. That includes the content reference node (s-cr) and, once the component has rendered, its own rendered nodes. On the next render the new content can't be relocated into the slot, so it gets hidden and the component renders empty.GitHub Issue Number: #6972
What is the new behavior?
Closes #6972
The
innerHTMLandinnerTextsetters are patched alongsidetextContent. They now remove only the slotted light-DOM content, including light-DOM nodes that haven't been relocated yet, and insert the new content into the default slot:innerHTMLcontent goes through the patchedinsertAdjacentHTML.innerTextcontent is appended as a text node.The getters are unchanged. The slotted-node removal used by the
textContentsetter is moved into a shared helper.In keeping with light-dom content fixes - this is just for interop with frameworks (Vue's v-html, Svelte's
{@html}and React's dangerouslySetInnerHTML) - notan exhaustive list of all browser accessors / methods - this
getaccessors here have been left untouched.Documentation
N/A
Does this introduce a breaking change?
Testing
New wdio test
inner-content-patch:innerHTMLset before the first render renders in the default slot;innerHTMLset after the first render replaces only the slotted content, and the component's own template survives a re-render;innerTextis inserted as text, not markup.