mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
refactor: file list focus logic
This commit is contained in:
parent
8549912adf
commit
a0a7545492
1 changed files with 2 additions and 4 deletions
|
|
@ -51,8 +51,7 @@ const handleKeyDown = dispatch => ({ key }) => dispatch(({ visibleNodes: { nodes
|
|||
case 'ArrowUp':
|
||||
// focus on previous node
|
||||
if (focusedNodeIndex === 0) {
|
||||
dispatch(focusNode, null)
|
||||
tasksAfterRender.push(DOMHelper.focusSearchInput)
|
||||
dispatch(focusNode, nodes[nodes.length - 1])
|
||||
} else {
|
||||
dispatch(focusNode, nodes[focusedNodeIndex - 1])
|
||||
}
|
||||
|
|
@ -63,8 +62,7 @@ const handleKeyDown = dispatch => ({ key }) => dispatch(({ visibleNodes: { nodes
|
|||
if (focusedNodeIndex + 1 < nodes.length) {
|
||||
dispatch(focusNode, nodes[focusedNodeIndex + 1])
|
||||
} else {
|
||||
dispatch(focusNode, null)
|
||||
tasksAfterRender.push(DOMHelper.focusSearchInput)
|
||||
dispatch(focusNode, nodes[0])
|
||||
}
|
||||
break
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue