Skip to content

Commit 791b127

Browse files
committed
Fixing issue with cursor jumping in Safari sveltejs#2506
1 parent e7885f2 commit 791b127

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/compile/render-dom/wrappers/Element/Binding.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export default class BindingWrapper {
111111

112112
let update_conditions: string[] = this.needs_lock ? [`!${lock}`] : [];
113113

114-
const dependency_array = [...this.node.expression.dependencies]
114+
const dependency_array = [...this.node.expression.dependencies];
115115

116116
if (dependency_array.length === 1) {
117117
update_conditions.push(`changed.${dependency_array[0]}`)
@@ -121,6 +121,14 @@ export default class BindingWrapper {
121121
)
122122
}
123123

124+
if (parent.node.name === 'input') {
125+
const type = parent.node.get_static_attribute_value('type');
126+
127+
if (type === null || type === "" || type === "text") {
128+
update_conditions.push(`(${parent.var}.${this.node.name} !== ${this.snippet})`)
129+
}
130+
}
131+
124132
// model to view
125133
let update_dom = get_dom_updater(parent, this);
126134

0 commit comments

Comments
 (0)