From 791b12776e7da7f5a5cd5a034efe620324ea58e1 Mon Sep 17 00:00:00 2001 From: Konstantin Alikhanov Date: Tue, 23 Apr 2019 18:20:22 +0400 Subject: [PATCH] Fixing issue with cursor jumping in Safari #2506 --- src/compile/render-dom/wrappers/Element/Binding.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/compile/render-dom/wrappers/Element/Binding.ts b/src/compile/render-dom/wrappers/Element/Binding.ts index 828d664001..a34a9466fc 100644 --- a/src/compile/render-dom/wrappers/Element/Binding.ts +++ b/src/compile/render-dom/wrappers/Element/Binding.ts @@ -111,7 +111,7 @@ export default class BindingWrapper { let update_conditions: string[] = this.needs_lock ? [`!${lock}`] : []; - const dependency_array = [...this.node.expression.dependencies] + const dependency_array = [...this.node.expression.dependencies]; if (dependency_array.length === 1) { update_conditions.push(`changed.${dependency_array[0]}`) @@ -121,6 +121,14 @@ export default class BindingWrapper { ) } + if (parent.node.name === 'input') { + const type = parent.node.get_static_attribute_value('type'); + + if (type === null || type === "" || type === "text") { + update_conditions.push(`(${parent.var}.${this.node.name} !== ${this.snippet})`) + } + } + // model to view let update_dom = get_dom_updater(parent, this);