(id: Key | undefined, state: TreeState<unknown>)
| 827 | } |
| 828 | |
| 829 | function isNextSelected(id: Key | undefined, state: TreeState<unknown>) { |
| 830 | if (id == null || !state) { |
| 831 | return false; |
| 832 | } |
| 833 | let keyAfter = state.collection.getKeyAfter(id); |
| 834 | |
| 835 | // We need to skip non-item nodes because the selection manager will map non-item nodes to their parent before checking selection |
| 836 | let node = keyAfter != null ? state.collection.getItem(keyAfter) : null; |
| 837 | while (node && node.type !== 'item' && keyAfter != null) { |
| 838 | keyAfter = state.collection.getKeyAfter(keyAfter); |
| 839 | node = keyAfter != null ? state.collection.getItem(keyAfter) : null; |
| 840 | } |
| 841 | |
| 842 | return keyAfter != null && state.selectionManager.isSelected(keyAfter); |
| 843 | } |
| 844 | |
| 845 | function isPrevSelected(id: Key | undefined, state: TreeState<unknown>) { |
| 846 | if (id == null || !state) { |
no test coverage detected