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

Function isPrevSelected

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

Source from the content-addressed store, hash-verified

836}
837
838function isPrevSelected(id: Key | undefined, state: TreeState<unknown>) {
839 if (id == null || !state) {
840 return false;
841 }
842 let keyBefore = state.collection.getKeyBefore(id);
843 return keyBefore != null && state.selectionManager.isSelected(keyBefore);
844}
845
846function isFirstItem(id: Key | undefined, state: TreeState<unknown>) {
847 if (id == null || !state) {

Callers 1

TreeViewItemContentFunction · 0.70

Calls 2

getKeyBeforeMethod · 0.65
isSelectedMethod · 0.65

Tested by

no test coverage detected