src/sap.ui.core/src/sap/ui/dom/jquery/Focusable.js
function findFocusableDomRef(oContainer, bForward) {

		var oChild = bForward ? oContainer.firstChild : oContainer.lastChild,
			oFocusableDescendant;

		while (oChild) {

			if ( oChild.nodeType == 1 && !isHidden(oChild) ) {

				if ( jQuery(oChild).hasTabIndex() ) {
					return oChild;
				}

				oFocusableDescendant = findFocusableDomRef(oChild, bForward);
				if (oFocusableDescendant) {
					return oFocusableDescendant;
				}

			}

			oChild = bForward ? oChild.nextSibling : oChild.previousSibling;

		}

		return null;
	}
function findFocusableDomRef(oContainer, bForward) {

		var oChild = bForward ? oContainer.firstChild : oContainer.lastChild,
			oFocusableDescendant;

		while (oChild) {

			if ( oChild.nodeType == 1 && !isHidden(oChild) ) {

				if ( jQuery(oChild).hasTabIndex() ) {
					return oChild;
				}

				oFocusableDescendant = findFocusableDomRef(oChild, bForward);
				if (oFocusableDescendant) {
					return oFocusableDescendant;
				}

			}

			oChild = bForward ? oChild.nextSibling : oChild.previousSibling;

		}

		return null;
	}
function findFocusableDomRef ( oContainer , bForward ) { var oChild = bForward ? oContainer . firstChild : oContainer . lastChild , oFocusableDescendant ; while ( oChild ) { if ( oChild . nodeType == 1 && ! isHidden ( oChild ) ) { if ( jQuery ( oChild ) . hasTabIndex ( ) ) { return oChild ; } oFocusableDescendant = findFocusableDomRef ( oChild , bForward ) ; if ( oFocusableDescendant ) { return oFocusableDescendant ; } } oChild = bForward ? oChild . nextSibling : oChild . previousSibling ; } return null ; }
Searches for a descendant of the given node that is an Element and focusable and visible.

The search is executed 'depth first'.

@param {Node} oContainer Node to search for a focusable descendant
@param {boolean} bForward Whether to search forward (true) or backwards (false)
@returns {Element} Element node that is focusable and visible or null
@private
Searches for a descendant of the given node that is an Element and focusable and visible .