From 5dd07d5d4bf90956046a6b39b7c1fa68f04ef6d2 Mon Sep 17 00:00:00 2001 From: Aditya Toshniwal Date: Mon, 15 Dec 2025 13:28:00 +0530 Subject: [PATCH] Fixed an issue where double click to open a file in the file manager is not working. #9196 --- docs/en_US/release_notes_9_12.rst | 1 + .../misc/file_manager/static/js/components/FileManager.jsx | 2 +- web/pgadmin/static/js/components/PgReactDataGrid.jsx | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/en_US/release_notes_9_12.rst b/docs/en_US/release_notes_9_12.rst index 15cccb87f..8836a4d65 100644 --- a/docs/en_US/release_notes_9_12.rst +++ b/docs/en_US/release_notes_9_12.rst @@ -29,6 +29,7 @@ Housekeeping Bug fixes ********* + | `Issue #9196 `_ - Fixed an issue where double click to open a file in the file manager is not working. | `Issue #9380 `_ - Fixed an issue where the Query History panel would auto-scroll to the top and did not preserve the scroll bar position for the selected entry. diff --git a/web/pgadmin/misc/file_manager/static/js/components/FileManager.jsx b/web/pgadmin/misc/file_manager/static/js/components/FileManager.jsx index 376affcc7..9593fa9c4 100644 --- a/web/pgadmin/misc/file_manager/static/js/components/FileManager.jsx +++ b/web/pgadmin/misc/file_manager/static/js/components/FileManager.jsx @@ -690,7 +690,7 @@ export default function FileManager({params, closeModal, onOK, onCancel, sharedS const onItemEnter = useCallback(async (row)=>{ if(row.file_type == 'dir' || row.file_type == 'drive') { await openDir(row.Path, selectedSS); - } else if(params.dialog_type == 'select_file') { + } else if(params.dialog_type == 'select_file' || params.dialog_type == 'open_file') { onOkClick(); } }, [finalItems]); diff --git a/web/pgadmin/static/js/components/PgReactDataGrid.jsx b/web/pgadmin/static/js/components/PgReactDataGrid.jsx index 5437874b5..2aa7c06c8 100644 --- a/web/pgadmin/static/js/components/PgReactDataGrid.jsx +++ b/web/pgadmin/static/js/components/PgReactDataGrid.jsx @@ -113,7 +113,10 @@ export function CustomRow({inTest=false, ...props}) { props.onRowClick?.(args.row); }; - const onCellDoubleClick = (args) => { + const onCellDoubleClick = (args, e) => { + // check if grid default is prevented. + props.onCellDoubleClick?.(args, e); + if(e.isGridDefaultPrevented()) return; gridUtils.onItemEnter?.(args.row); };