fix: support contenteditable binding undefined fallback

pull/12210/head
Dominic Gannaway 3 days ago
parent d3111db1ef
commit b0154111fd

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: support contenteditable binding undefined fallback

@ -18,7 +18,7 @@ export function bind_content_editable(property, element, get_value, update) {
var value = get_value();
if (element[property] !== value) {
if (value === null) {
if (value == null) {
// @ts-ignore
var non_null_value = element[property];
update(non_null_value);

@ -0,0 +1,9 @@
<script>
let {children} = $props()
let innerText = $state()
$inspect(innerText);
</script>
<div contenteditable="true" bind:innerHTML={innerText}>
{@render children()}
</div>

@ -0,0 +1,5 @@
import { test } from '../../test';
export default test({
html: `<div contenteditable="true">Test</div>`
});

@ -0,0 +1,7 @@
<script>
import Test from './Test.svelte'
</script>
<Test>
Test
</Test>
Loading…
Cancel
Save