Blaze: Don't update input elements if their value doesn't need updating

This resolves #2403. Specifically, if you implement some form of
two-way databinding, and you modify an input field in some way
other than adding characters to the end, the insertion point
jumps to the end.

Still need to write a test for this.
This commit is contained in:
Avital Oliver
2014-08-15 11:48:51 -07:00
parent 328ecb4d98
commit c2cf67179f

View File

@@ -165,7 +165,8 @@ var BooleanHandler = AttributeHandler.extend({
var ValueHandler = AttributeHandler.extend({
update: function (element, oldValue, value) {
element.value = value;
if (value !== element.value)
element.value = value;
}
});