diff --git a/src/runtime/internal/dev.ts b/src/runtime/internal/dev.ts index 76d68086c841..f8a0a313cabf 100644 --- a/src/runtime/internal/dev.ts +++ b/src/runtime/internal/dev.ts @@ -83,10 +83,14 @@ export function dataset_dev(node: HTMLElement, property: string, value?: any) { export function set_data_dev(text, data) { data = '' + data; - if (text.wholeText === data) return; + if (text.data === data) return; - dispatch_dev('SvelteDOMSetData', { node: text, data }); - text.data = data; + console.log(text.parentNode.hasAttribute('contenteditable')); + if (text.parentNode && text.parentNode.hasAttribute('contenteditable')) { + text.innerText = data; + } else { + text.data = data; + } } export function validate_each_argument(arg) { diff --git a/src/runtime/internal/dom.ts b/src/runtime/internal/dom.ts index eb3389e3f863..ac17c263e229 100644 --- a/src/runtime/internal/dom.ts +++ b/src/runtime/internal/dom.ts @@ -514,7 +514,13 @@ export function claim_html_tag(nodes) { export function set_data(text, data) { data = '' + data; - if (text.wholeText !== data) text.data = data; + if (text.data === data) return; + + if (text.parentNode && text.parentNode.hasAttribute('contenteditable')) { + text.innerText = data; + } else { + text.data = data; + } } export function set_input_value(input, value) {