function handleTypeAhead(sValue, oInput, aItems, vTextGetter) {
		var sSelectedItemText,
			bDesktopPlatform = Device.system.desktop,
			aSelectedItems = _filterItems(sValue, aItems, vTextGetter);

		if (!Array.isArray(aSelectedItems) || !aSelectedItems.length) {
			return [];
		}

		aSelectedItems = _sortItems(sValue, aSelectedItems, vTextGetter); // It's important to sort the items with the best match
		sSelectedItemText = _findBestTextMatch(_extractTextsFromItem(aSelectedItems[0], vTextGetter), sValue);

		if (!oInput.isComposingCharacter() && sSelectedItemText) {
			oInput.updateDomValue(sSelectedItemText);
		}

		if (bDesktopPlatform) {
			_selectTextIfFocused(oInput, sValue.length, oInput.getValue().length);
		} else {
			// timeout required for an Android and Windows Phone bug
			setTimeout(_selectTextIfFocused.bind(null, oInput, sValue.length, oInput.getValue().length), 0);
		}

		return aSelectedItems || [];
	}
/**
	 * Handles DOM update, text highlighting and input focusing of the selected item.
	 *
	 * @param sValue {string} Typed in value.
	 * @param oInput {sap.m.Input} Input to act upon.
	 * @param aItems {array<T>} Items to pick from.
	 * @param vTextGetter {string|function} Name of method in oInput or a function which extracts the text.
	 * @returns {Array<T>} A sorted array of matching items. The first item is the one that's being highlighted.
	 */
Handles DOM update, text highlighting and input focusing of the selected item.
@param sValue {string} Typed in value.
@param oInput {sap.m.Input} Input to act upon.
@param aItems {array} Items to pick from.
@param vTextGetter {string|function} Name of method in oInput or a function which extracts the text.
@returns {Array} A sorted array of matching items. The first item is the one that's being highlighted.
Handles DOM update text highlighting and input focusing of the selected item . @param sValue { string } Typed in value . @param oInput { sap . m . Input } Input to act upon . @param aItems { array } Items to pick from . @param vTextGetter { string|function } Name of method in oInput or a function which extracts the text . @returns { Array } A sorted array of matching items . The first item is the one that ' s being highlighted .
function handleTypeAhead(sValue, oInput, aItems, vTextGetter) {
		var sSelectedItemText,
			bDesktopPlatform = Device.system.desktop,
			aSelectedItems = _filterItems(sValue, aItems, vTextGetter);
		if (!Array.isArray(aSelectedItems) || !aSelectedItems.length) {
			return [];
		}
		aSelectedItems = _sortItems(sValue, aSelectedItems, vTextGetter); 
		sSelectedItemText = _findBestTextMatch(_extractTextsFromItem(aSelectedItems[0], vTextGetter), sValue);
		if (!oInput.isComposingCharacter() && sSelectedItemText) {
			oInput.updateDomValue(sSelectedItemText);
		}
		if (bDesktopPlatform) {
			_selectTextIfFocused(oInput, sValue.length, oInput.getValue().length);
		} else {
			setTimeout(_selectTextIfFocused.bind(null, oInput, sValue.length, oInput.getValue().length), 0);
		}
		return aSelectedItems || [];
	}
function handleTypeAhead ( sValue , oInput , aItems , vTextGetter ) { var sSelectedItemText , bDesktopPlatform = Device . system . desktop , aSelectedItems = _filterItems ( sValue , aItems , vTextGetter ) ; if ( ! Array . isArray ( aSelectedItems ) || ! aSelectedItems . length ) { return [ ] ; } aSelectedItems = _sortItems ( sValue , aSelectedItems , vTextGetter ) ; sSelectedItemText = _findBestTextMatch ( _extractTextsFromItem ( aSelectedItems [ 0 ] , vTextGetter ) , sValue ) ; if ( ! oInput . isComposingCharacter ( ) && sSelectedItemText ) { oInput . updateDomValue ( sSelectedItemText ) ; } if ( bDesktopPlatform ) { _selectTextIfFocused ( oInput , sValue . length , oInput . getValue ( ) . length ) ; } else { setTimeout ( _selectTextIfFocused . bind ( null , oInput , sValue . length , oInput . getValue ( ) . length ) , 0 ) ; } return aSelectedItems || [ ] ; }
Handles DOM update, text highlighting and input focusing of the selected item.
Handles DOM update text highlighting and input focusing of the selected item .
// It's important to sort the items with the best match // timeout required for an Android and Windows Phone bug