From 7946ee78f6ff25b1d7f658d4061855ae065ac8fe Mon Sep 17 00:00:00 2001 From: Akshay Joshi Date: Tue, 17 Jun 2025 16:19:41 +0530 Subject: [PATCH] Ensure that Keyboard shortcuts for save and download actions should not called when their respective UI buttons are disabled. #8803 --- docs/en_US/release_notes_9_5.rst | 1 + .../static/js/components/sections/ResultSetToolbar.jsx | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/en_US/release_notes_9_5.rst b/docs/en_US/release_notes_9_5.rst index bcbad57be..2809b1f3e 100644 --- a/docs/en_US/release_notes_9_5.rst +++ b/docs/en_US/release_notes_9_5.rst @@ -40,6 +40,7 @@ Bug fixes | `Issue #8032 `_ - Fixed an issue where the Schema Diff Tool incorrectly reported differences due to variations in the order of the privileges. | `Issue #8235 `_ - Fixed an issue in SQL syntax highlighting where the same color was used for both variable names and datatypes. | `Issue #8691 `_ - Fixed an issue in the query tool where using multiple cursors to copy text resulted in only the first line being copied. + | `Issue #8803 `_ - Ensure that Keyboard shortcuts for save and download actions should not called when their respective UI buttons are disabled. | `Issue #8808 `_ - Fixed an issue where data export using a query opened the wrong dialog type. | `Issue #8809 `_ - Fixed an issue where data export using a query failed when the query contained a newline character. | `Issue #8834 `_ - Fixed an issue where the Columns node was not visible under Catalog Objects. \ No newline at end of file diff --git a/web/pgadmin/tools/sqleditor/static/js/components/sections/ResultSetToolbar.jsx b/web/pgadmin/tools/sqleditor/static/js/components/sections/ResultSetToolbar.jsx index fd03aac55..f7bbebb8c 100644 --- a/web/pgadmin/tools/sqleditor/static/js/components/sections/ResultSetToolbar.jsx +++ b/web/pgadmin/tools/sqleditor/static/js/components/sections/ResultSetToolbar.jsx @@ -367,13 +367,18 @@ export function ResultSetToolbar({query, canEdit, totalRowCount, pagination, all { shortcut: queryToolPref.save_data, options: { - callback: ()=>{saveData();} + callback: ()=>{!buttonsDisabled['save-data'] && saveData();} } }, { shortcut: queryToolPref.download_results, options: { - callback: (e)=>{e.preventDefault(); downloadResult();} + callback: (e)=>{ + if (!buttonsDisabled['save-result']) { + e.preventDefault(); + downloadResult(); + } + } } }, ], queryToolCtx.mainContainerRef);