When binding a value to an input box using the custom notify event syntax, you lose the caret index when adding a character. The selectionStart always jumps to the end.
<input value="{{value::input}}" />
http://jsbin.com/situwa/2/edit?html,output
When digging in the _effects.html_, the value of the input is set, even though it has the same value already.
_applyEffectValue: function(value, info) {
var node = this._nodes[info.index];
// TODO(sorvell): ideally, the info object is normalized for easy
// lookup here.
var property = info.property || info.name || 'textContent';
// special processing for 'class' and 'className'; 'class' handled
// when attr is serialized.
if (info.kind == 'attribute') {
this.serializeValueToAttribute(value, property, node);
} else {
// TODO(sorvell): consider pre-processing this step so we don't need
// this lookup.
if (property === 'className') {
value = this._scopeElementClass(node, value);
}
return node[property] = value;
}
}
At the end of this method return node[property] = value; causes the input's value to be overwritten with the same value which moves the caret to the end.
Can we maybe change it to the following?
if(node[property] !== value)
node[property] = value;
return value;
When binding a value to an input box using the custom notify event syntax, you lose the caret index when adding a character. The selectionStart always jumps to the end.
http://jsbin.com/situwa/2/edit?html,output
When digging in the _effects.html_, the value of the input is set, even though it has the same value already.
At the end of this method
return node[property] = value;causes the input's value to be overwritten with the same value which moves the caret to the end.Can we maybe change it to the following?