Fixed an issue where right-clicking a browser object does not apply to the object on which right-click was fired. Fixes #3523

Fixes keyboard navigation on the context menu applied to browser tree.
This commit is contained in:
Aditya Toshniwal
2020-04-10 17:34:57 +05:30
committed by Akshay Joshi
parent 4de6b93ba8
commit 077589e08b
2 changed files with 22 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ Bug fixes
*********
| `Issue #2813 <https://redmine.postgresql.org/issues/2813>`_ - Ensure that the password prompt should not be visible if the database server is in trust authentication mode.
| `Issue #3523 <https://redmine.postgresql.org/issues/3523>`_ - Fixed an issue where right-clicking a browser object does not apply to the object on which right-click was fired.
| `Issue #3645 <https://redmine.postgresql.org/issues/3645>`_ - Ensure that the start and end date should be deleted when clear the selection for pgAgent Job.
| `Issue #3972 <https://redmine.postgresql.org/issues/3972>`_ - Modified keyboard shortcuts in Query Tool for OSX native support.
| `Issue #3988 <https://redmine.postgresql.org/issues/3988>`_ - Fixed cursor disappeared issue in the query editor for some of the characters when zoomed out.

View File

@@ -371,6 +371,27 @@ export class Tree {
}
}.bind(this));
this.aciTreeApi = $treeJQuery.aciTree('api');
/* Ctrl + Click will trigger context menu. Select the node when Ctrl+Clicked.
* When the context menu is visible, the tree should lose focus
* to use context menu with keyboard. Otherwise, the tree functions
* overrides the keyboard events.
*/
let contextHandler = (ev)=>{
let treeItem = this.aciTreeApi.itemFrom(ev.target);
if(treeItem.length) {
if(ev.ctrlKey) {
this.aciTreeApi.select(treeItem);
}
$(treeItem).on('contextmenu:visible', ()=>{
$(treeItem).trigger('blur');
$(treeItem).off('contextmenu:visible');
});
}
};
$treeJQuery
.off('mousedown', contextHandler)
.on('mousedown', contextHandler);
}
/**