From 2cd66c0447cdcf7d1a0f42de513047d553467bcc Mon Sep 17 00:00:00 2001 From: Vlad Glushchuk Date: Sat, 20 Apr 2019 08:11:57 +0200 Subject: [PATCH] Fix the cursor reset issue --- src/compiler/compile/render-dom/wrappers/Element/Binding.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/compile/render-dom/wrappers/Element/Binding.ts b/src/compiler/compile/render-dom/wrappers/Element/Binding.ts index 8eb5ba8097..74a7bd86ab 100644 --- a/src/compiler/compile/render-dom/wrappers/Element/Binding.ts +++ b/src/compiler/compile/render-dom/wrappers/Element/Binding.ts @@ -196,11 +196,11 @@ function get_dom_updater( } if (binding.node.name === 'text') { - return `${element.var}.textContent = ${binding.snippet};`; + return `if (${binding.snippet} !== ${element.var}.textContent) ${element.var}.textContent = ${binding.snippet};`; } if (binding.node.name === 'html') { - return `${element.var}.innerHTML = ${binding.snippet};`; + return `if (${binding.snippet} !== ${element.var}.innerHTML) ${element.var}.innerHTML = ${binding.snippet};`; } return `${element.var}.${binding.node.name} = ${binding.snippet};`;