mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
refactor(FileExplorer): stop blocking event
This commit is contained in:
parent
6c7823097b
commit
be9f258be3
1 changed files with 0 additions and 11 deletions
|
|
@ -53,7 +53,6 @@ const execAfterRender = dispatch => () => {
|
|||
}
|
||||
|
||||
const handleKeyDown = dispatch => ({ key }) => dispatch(({ visibleNodes: { nodes, focusedNode, expandedNodes, depths } }) => {
|
||||
let shouldStopPropagation = true // prevent body scrolling
|
||||
if (focusedNode) {
|
||||
const focusedNodeIndex = nodes.indexOf(focusedNode)
|
||||
switch (key) {
|
||||
|
|
@ -121,8 +120,6 @@ const handleKeyDown = dispatch => ({ key }) => dispatch(({ visibleNodes: { nodes
|
|||
}
|
||||
break
|
||||
|
||||
default:
|
||||
shouldStopPropagation = false
|
||||
}
|
||||
} else {
|
||||
// now search input is focused
|
||||
|
|
@ -134,17 +131,9 @@ const handleKeyDown = dispatch => ({ key }) => dispatch(({ visibleNodes: { nodes
|
|||
case 'ArrowUp':
|
||||
dispatch(focusNode, nodes[nodes.length - 1])
|
||||
break
|
||||
default:
|
||||
shouldStopPropagation = false
|
||||
}
|
||||
} else {
|
||||
shouldStopPropagation = false
|
||||
}
|
||||
}
|
||||
if (shouldStopPropagation) {
|
||||
event.stopPropagation()
|
||||
event.preventDefault()
|
||||
}
|
||||
})
|
||||
|
||||
const handleSearchKeyChange = dispatch => async event => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue