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