fix: support contenteditable binding undefined fallback (#12210)

pull/12190/head
Dominic Gannaway 6 months ago committed by GitHub
parent 41c8c745fa
commit 7c95c7b662
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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