From 5d7ec140767c63447a6dfa7004c123ca0ef390ec Mon Sep 17 00:00:00 2001 From: Rohit Bhati Date: Thu, 1 Aug 2024 11:48:16 +0530 Subject: [PATCH] Fixed delete object(shortcut key) affecting both text and Object Explorer items. #7683 --- web/pgadmin/browser/static/js/keyboard.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/pgadmin/browser/static/js/keyboard.js b/web/pgadmin/browser/static/js/keyboard.js index 9a17d4fc8..787fbd2c1 100644 --- a/web/pgadmin/browser/static/js/keyboard.js +++ b/web/pgadmin/browser/static/js/keyboard.js @@ -262,9 +262,9 @@ _.extend(pgBrowser.keyboardNavigation, { node_obj, {action: 'create', item: tree.i} ); }, - bindSubMenuDelete: function() { + bindSubMenuDelete: function(event) { const tree = this.getTreeDetails(); - if (!tree.d || pgAdmin.Browser.Nodes[tree.t.itemData(tree.i)._type].collection_node === true || document.activeElement.className !== 'file-tree') + if (!tree.d || pgAdmin.Browser.Nodes[tree.t.itemData(tree.i)._type].collection_node === true || !event?.target?.classList?.contains('file-tree')) return; // Call delete object callback