[RM#4906][pgAdmin4] Fix context menu keyboard shortcut issue with Firefox

Murtuza Zabuawala <[email protected]>
Newsgroups gmane.comp.db.postgresql.pgadmin.devel
Message-ID <CAKKotZSkn+32uiD2aO-=LF0JgdXPO6cBeaY_oC-4TSesNxRinQ@mail.gmail.com>
Hello,

PFA patch to fix the issue where keyboard shortcut for context menu is not
working when using Firefox on CestOS7.


--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
RM_4906.diff (application/octet-stream, 807 B)
diff --git a/web/pgadmin/browser/static/js/keyboard.js b/web/pgadmin/browser/static/js/keyboard.js
index 1a402da8d..ba1a7806d 100644
--- a/web/pgadmin/browser/static/js/keyboard.js
+++ b/web/pgadmin/browser/static/js/keyboard.js
@@ -307,8 +307,9 @@ _.extend(pgBrowser.keyboardNavigation, {
   },
   bindContextMenu: function(event) {
     const tree = this.getTreeDetails();
-    const left = $(event.srcElement).find('.aciTreeEntry').position().left + 70;
-    const top = $(event.srcElement).find('.aciTreeEntry').position().top + 70;
+    let _srcElement = event.srcElement || event.target;
+    const left = $(_srcElement).find('.aciTreeEntry').position().left + 70;
+    const top = $(_srcElement).find('.aciTreeEntry').position().top + 70;
 
     tree.t.blur(tree.i);
     $('#tree').trigger('blur');
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.