Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
open folder on double click (#10864)
Browse files Browse the repository at this point in the history
  • Loading branch information
achen5671 authored Aug 5, 2024
1 parent 8c42964 commit c108d09
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ const FileBrowserContentPanel: React.FC<FileBrowserContentPanelProps> = (props)
fileQuery.setPage(0)
}

const onSelect = (params: FileDataType) => {
const onSelect = (event, params: FileDataType) => {
if (params.type !== 'folder') {
props.onSelectionChanged({
resourceUrl: params.url,
Expand All @@ -306,8 +306,10 @@ const FileBrowserContentPanel: React.FC<FileBrowserContentPanelProps> = (props)

ClickPlacementState.setSelectedAsset(params.url)
} else {
const newPath = `${selectedDirectory.value}${params.name}/`
changeDirectoryByPath(newPath)
if (event.detail === 2) {
const newPath = `${selectedDirectory.value}${params.name}/`
changeDirectoryByPath(newPath)
}
}
}

Expand Down Expand Up @@ -583,7 +585,7 @@ const FileBrowserContentPanel: React.FC<FileBrowserContentPanelProps> = (props)
projectName={projectName}
onClick={(event, currentFile) => {
handleFileBrowserItemClick(event, currentFile)
onSelect(file)
onSelect(event, file)
}}
currentContent={currentContentRef}
handleDropItemsOnPanel={(data, dropOn) =>
Expand Down

0 comments on commit c108d09

Please sign in to comment.