Currently, the $edit-text widget supports a focus="yes"
parameter, which is handled by
$:/core/modules/editor/engines/simple.js
, here:
SimpleEngine.prototype.focus = function() {
if(this.domNode.focus && this.domNode.select) {
this.domNode.focus();
this.domNode.select();
}
};
and by $:/core/modules/editor/engines/framed.js
, here:
FramedEngine.prototype.focus = function() {
if(this.domNode.focus && this.domNode.select) {
this.domNode.focus();
this.domNode.select();
}
};
Note that these functions not only set the input focus on the domNode, but they also select the domNode contents.
In order to support the proposed new behavior, this handling would need to be re-written. I suggest adding a new select="no"
parameter to the $edit-text
text widget so that the current hard-coded behavior can be bypassed if desired.
Note that, for backward compatibility, the default when this new parameter is omitted must be to still select the domNode contents as it presently does.