Allow textContent
/ innerHTML
/ innerText
binding without setting the contenteditable
attribute
#11654
Labels
textContent
/ innerHTML
/ innerText
binding without setting the contenteditable
attribute
#11654
Describe the problem
Svelte already allows you to create read-only bindings (e.g.
<svelte:window bind:innerWidth />
).But in the case of element content binding, the
contenteditable
attribute is required. Otherwise we get an error:Svelte 5 (runes) example
But this can be easily hacked by adding
contenteditable="false"
.Svelte 4 example (there is no example with Svelte 5 because of this.)
Describe the proposed solution
Remove the requirement of a mandatory
contenteditable
attribute for binding to element content.Importance
would make my life easier
The text was updated successfully, but these errors were encountered: