fix reset focus

flattentree
filip mertens 11 months ago
parent f45a98642b
commit 2cfbfcacdf
  1. 9
      libs/remix-ui/workspace/src/lib/components/file-explorer.tsx

@ -346,10 +346,6 @@ export const FileExplorer = (props: FileExplorerProps) => {
}, [])
const handleTreeClick = (event: SyntheticEvent) => {
event.stopPropagation()
//console.log('tree click', event.target)
let target = event.target as HTMLElement
while (target && target.getAttribute && !target.getAttribute('data-path')) {
target = target.parentElement
@ -358,12 +354,11 @@ export const FileExplorer = (props: FileExplorerProps) => {
const path = target.getAttribute('data-path')
const type = target.getAttribute('data-type')
if (path && type === 'file') {
console.log('tree click', path)
event.stopPropagation()
if (state.focusEdit.element !== path) handleClickFile(path, type)
} else if (path && type === 'folder') {
console.log('tree click', path)
event.stopPropagation()
if (state.focusEdit.element !== path) handleClickFolder(path, type)
}

Loading…
Cancel
Save