Skip to content

Commit

Permalink
Fixing issue with cursor jumping in Safari sveltejs#2506
Browse files Browse the repository at this point in the history
  • Loading branch information
atomAltera committed Apr 23, 2019
1 parent e7885f2 commit 96fe8c5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/compile/render-dom/wrappers/Element/Binding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,14 @@ function get_dom_updater(
return `${element.var}.checked = ${condition};`
}

if (node.name === 'input') {
const type = node.get_static_attribute_value('type');

if (type === null || type === "" || type === "text") {
return `if (${element.var}.${binding.node.name} !== ${binding.snippet}) ${element.var}.${binding.node.name} = ${binding.snippet};`
}
}

return `${element.var}.${binding.node.name} = ${binding.snippet};`;
}

Expand Down

0 comments on commit 96fe8c5

Please sign in to comment.