Skip to content

Commit

Permalink
Merge pull request #2511 from atomAltera/fix/2506
Browse files Browse the repository at this point in the history
Fixing issue with cursor jumping in Safari #2506
  • Loading branch information
Rich-Harris authored Apr 25, 2019
2 parents f386786 + 791b127 commit 48ebaac
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/compile/render-dom/wrappers/Element/Binding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]}`)
Expand All @@ -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);

Expand Down

0 comments on commit 48ebaac

Please sign in to comment.