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

Function isPrevSelected

packages/@react-spectrum/s2/src/TreeView.tsx:845–851  ·  view source on GitHub ↗
(id: Key | undefined, state: TreeState<unknown>)

Source from the content-addressed store, hash-verified

843}
844
845function isPrevSelected(id: Key | undefined, state: TreeState<unknown>) {
846 if (id == null || !state) {
847 return false;
848 }
849 let keyBefore = state.collection.getKeyBefore(id);
850 return keyBefore != null && state.selectionManager.isSelected(keyBefore);
851}
852
853function isFirstItem(id: Key | undefined, state: TreeState<unknown>) {
854 if (id == null || !state) {

Callers 1

TreeViewItemContentFunction · 0.70

Calls 2

getKeyBeforeMethod · 0.65
isSelectedMethod · 0.65

Tested by

no test coverage detected