mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
fix(FileExplorer): not scrolling to target when opening a file/folder directly
This commit is contained in:
parent
0d74d96261
commit
ad557477f9
1 changed files with 2 additions and 2 deletions
|
|
@ -28,6 +28,8 @@ export default class List extends preact.Component {
|
|||
const { root, nodes } = treeParser.parse(treeData, metaData)
|
||||
this.visibleNodesGenerator.plantTree(root, nodes)
|
||||
const currentPath = URLHelper.getCurrentPath()
|
||||
this.tasksAfterRender.push(DOMHelper.focusFileExplorer)
|
||||
this.tasksAfterRender.push(DOMHelper.focusSearchInput)
|
||||
if (currentPath.length) {
|
||||
const nodeExpandedTo = this.visibleNodesGenerator.expandTo(currentPath)
|
||||
this.visibleNodesGenerator.focusNode(nodeExpandedTo)
|
||||
|
|
@ -35,8 +37,6 @@ export default class List extends preact.Component {
|
|||
this.tasksAfterRender.push(() => DOMHelper.scrollToNodeElement(nodes.indexOf(nodeExpandedTo)))
|
||||
}
|
||||
this.updateVisibleNodes()
|
||||
this.tasksAfterRender.push(DOMHelper.focusFileExplorer)
|
||||
this.tasksAfterRender.push(DOMHelper.focusSearchInput)
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue