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/2357/head
Jacob Wright 7 years ago
parent b161725a51
commit 6ef8137b4b

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

Loading…
Cancel
Save