Skip to content

Commit 702226d

Browse files
committed
more
1 parent 0c34327 commit 702226d

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ export function RegularElement(node, context) {
8585
const is_custom_element = is_custom_element_node(node);
8686
let needs_content_reset = false;
8787

88-
let is_content_editable = false;
89-
9088
if (is_custom_element) {
9189
// cloneNode is faster, but it does not instantiate the underlying class of the
9290
// custom element until the template is connected to the dom, which would
@@ -119,12 +117,6 @@ export function RegularElement(node, context) {
119117
!is_text_attribute(attribute)
120118
) {
121119
needs_content_reset = true;
122-
} else if (
123-
attribute.name === 'contenteditable' &&
124-
(attribute.value === true ||
125-
(is_text_attribute(attribute) && attribute.value[0].data === 'true'))
126-
) {
127-
is_content_editable = true;
128120
}
129121
} else if (attribute.type === 'SpreadAttribute') {
130122
has_spread = true;
@@ -156,9 +148,17 @@ export function RegularElement(node, context) {
156148
}
157149
}
158150

159-
child_metadata.bound_contenteditable =
160-
is_content_editable &&
161-
(bindings.has('innerHTML') || bindings.has('innerText') || bindings.has('textContent'));
151+
if (bindings.has('innerHTML') || bindings.has('innerText') || bindings.has('textContent')) {
152+
const contenteditable = lookup.get('contenteditable');
153+
154+
if (
155+
contenteditable &&
156+
(contenteditable.value === true ||
157+
(is_text_attribute(contenteditable) && contenteditable.value[0].data === 'true'))
158+
) {
159+
child_metadata.bound_contenteditable = true;
160+
}
161+
}
162162

163163
if (
164164
node.name === 'input' &&

0 commit comments

Comments
 (0)