0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-12-01 17:30:59 +01:00

Fixing issue with cursor jumping in Safari #2506

This commit is contained in:
Konstantin Alikhanov 2019-04-23 18:20:22 +04:00
parent e7885f2cb1
commit 791b12776e

View File

@ -111,7 +111,7 @@ export default class BindingWrapper {
let update_conditions: string[] = this.needs_lock ? [`!${lock}`] : []; 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) { if (dependency_array.length === 1) {
update_conditions.push(`changed.${dependency_array[0]}`) 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 // model to view
let update_dom = get_dom_updater(parent, this); let update_dom = get_dom_updater(parent, this);