Update text.data only when necessary

Only update the text node if the text node's value is not equal. This fix is for contenteditable usage where text content may change outside of Svelte's control in order to preserve text composition.

Accomplishes the same thing as #2341 without the added API.
pull/7738/head
Jacob Wright 7 years ago
parent 4de418a87f
commit 82baceb8ac

@ -154,7 +154,7 @@ export function claim_text(nodes, data) {
} }
export function set_data(text, data) { export function set_data(text, data) {
text.data = '' + data; if (text.data !== '' + data) text.data = '' + data;
} }
export function set_input_type(input, type) { export function set_input_type(input, type) {

Loading…
Cancel
Save