Skip to content

Commit a6b3f4e

Browse files
committed
simplify
1 parent 00ec75e commit a6b3f4e

File tree

1 file changed

+2
-7
lines changed
  • packages/svelte/src/compiler/phases/3-transform/client/visitors/shared

1 file changed

+2
-7
lines changed

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,13 @@ export function process_children(nodes, expression, is_element, { visit, state }
6666

6767
state.template.push(' ');
6868

69-
const { has_call, value } = build_template_literal(sequence, visit, state);
69+
const { has_state, has_call, value } = build_template_literal(sequence, visit, state);
7070

7171
const update = b.stmt(b.call('$.set_text', text_id, value));
7272

7373
if (has_call && !within_bound_contenteditable) {
7474
state.init.push(build_update(update));
75-
} else if (
76-
sequence.some(
77-
(node) => node.type === 'ExpressionTag' && node.metadata.expression.has_state
78-
) &&
79-
!within_bound_contenteditable
80-
) {
75+
} else if (has_state && !within_bound_contenteditable) {
8176
state.update.push(update);
8277
} else {
8378
state.init.push(b.stmt(b.assignment('=', b.member(text_id, b.id('nodeValue')), value)));

0 commit comments

Comments
 (0)