MCPcopy Index your code
hub / github.com/UI5/webcomponents / _handleF7

Method _handleF7

packages/compat/src/Table.ts:761–778  ·  view source on GitHub ↗

* Toggles focus between the table row's root and the last focused nested element. * @private

(e: CustomEvent<TableRowF7PressEventDetail>)

Source from the content-addressed store, hash-verified

759 * @private
760 */
761 _handleF7(e: CustomEvent<TableRowF7PressEventDetail>) {
762 const row = e.detail.row;
763 row.tabbableElements = getTabbableElements(row);
764 const activeElement = getActiveElement();
765 const lastFocusedElement = row.tabbableElements[this._prevNestedElementIndex] || row.tabbableElements[0];
766 const targetIndex = row.tabbableElements.indexOf(activeElement as HTMLElement);
767
768 if (!row.tabbableElements.length) {
769 return;
770 }
771
772 if (activeElement === row.root) {
773 lastFocusedElement.focus();
774 } else if (targetIndex > -1) {
775 this._prevNestedElementIndex = targetIndex;
776 row.root.focus();
777 }
778 }
779
780 _onfocusin(e: FocusEvent) {
781 const target = getNormalizedTarget(e.target as HTMLElement);

Callers

nothing calls this directly

Calls 3

getTabbableElementsFunction · 0.85
getActiveElementFunction · 0.85
focusMethod · 0.45

Tested by

no test coverage detected