sap.m.Input._doSelect has inconsistent return types: void & this
In openui5-runtime-mobile-1.20.6.zip\resources\sap\m\Input-dbg.js, line 785, _doSelect has inconsistent return types: "return;" in line 787 "return this;" in line 796
/**
* Selects the text of the InputDomRef in the given range
* @param {int} [iStart=0] start position of the text selection
* @param {int} [iEnd=<length of text>] end position of the text selection
* @return {sap.m.Input} this Input instance
* @private
*/
sap.m.Input.prototype._doSelect = function(iStart, iEnd){
if(sap.ui.Device.support.touch){
return;
}
var oDomRef = this._$input[0];
if (oDomRef) {
//if no Dom-Ref - no selection (Maybe popup closed)
var $Ref = this._$input;
oDomRef.focus();
$Ref.selectText(iStart?iStart:0, iEnd?iEnd:$Ref.val().length);
}
return this;
};
Even it looks like an error we can take this as a bug report since it is not allowed to use private/protected functions from outside of the control. But i will talk with control owner to make it consistent. Thanks for your feedback.
Hi, I just thought that this can cause issues to "clean" users of the control, whether they adhere to the "private"/"protected" convention (rule) or not.
Talking of "private", the documentation might have to be fixed, I believe it should state "must NOT": "Private methods are identified by a name starting with an underscore and must be called from outside the control." https://openui5.hana.ondemand.com/docs/guide/85738e3ac3bb407d9e1cfeb8bb9268cb.html
Cheers.
Thanks for the hint about the documentation. We'll correct it.