MCPcopy Index your code
hub / github.com/adobe/react-spectrum / focusLast

Function focusLast

packages/react-aria/src/focus/FocusScope.tsx:270–281  ·  view source on GitHub ↗
(opts = {})

Source from the content-addressed store, hash-verified

268 return nextNode;
269 },
270 focusLast(opts = {}) {
271 let scope = scopeRef.current!;
272 let {tabbable, accept} = opts;
273 let scopeRoot = getScopeRoot(scope);
274 let walker = getFocusableTreeWalker(scopeRoot, {tabbable, accept}, scope);
275 walker.currentNode = scope[scope.length - 1].nextElementSibling!;
276 let previousNode = walker.previousNode() as FocusableElement;
277 if (previousNode) {
278 focusElement(previousNode, true);
279 }
280 return previousNode;
281 }
282 };
283}
284

Callers

nothing calls this directly

Calls 5

getScopeRootFunction · 0.85
getFocusableTreeWalkerFunction · 0.85
focusElementFunction · 0.85
previousNodeMethod · 0.80
lastFunction · 0.70

Tested by

no test coverage detected