MCPcopy Create free account
hub / github.com/adobe/react-spectrum / last

Function last

packages/react-aria/src/gridlist/useGridListItem.ts:524–534  ·  view source on GitHub ↗
(walker: TreeWalker)

Source from the content-addressed store, hash-verified

522}
523
524function last(walker: TreeWalker) {
525 let next: FocusableElement | null = null;
526 let last: FocusableElement | null = null;
527 do {
528 last = walker.lastChild() as FocusableElement | null;
529 if (last) {
530 next = last;
531 }
532 } while (last);
533 return next;
534}
535
536function getDirectChildren<T>(parent: RSNode<T>, collection: Collection<RSNode<T>>) {
537 // We can't assume that we can use firstChildKey because if a person builds a tree using hooks, they would not have access to that property (using type Node vs CollectionNode)

Callers 1

onKeyDownCaptureFunction · 0.70

Calls 1

lastChildMethod · 0.45

Tested by

no test coverage detected