mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed tab key navigation for some dialogs. Fixes #5371
This commit is contained in:
committed by
Akshay Joshi
parent
21cb1a0166
commit
a05acb4f99
@@ -1555,7 +1555,7 @@ define('pgadmin.browser.node', [
|
||||
}
|
||||
let btnGroup = $(panel.$container.find('.pg-prop-btn-group'));
|
||||
let el = $(btnGroup).find('button:first');
|
||||
if (panel.$container.find('td.editable:last').is(':visible')){
|
||||
if (panel.$container.find('.number-cell.editable:last').is(':visible')){
|
||||
if (event.keyCode === 9 && event.shiftKey) {
|
||||
if ($(el).is($(event.target))){
|
||||
$(panel.$container.find('td.editable:last').trigger('click'));
|
||||
|
||||
@@ -240,61 +240,7 @@ define([
|
||||
return true;
|
||||
},
|
||||
keydownHandler: function(event) {
|
||||
let wizardHeader = $(event.currentTarget).find('.wizard-header');
|
||||
let wizardFooter = $(event.currentTarget).find('.wizard-footer');
|
||||
let gridElement = $(event.currentTarget).find('.select-row-cell:first');
|
||||
let gridElementLast = $(event.currentTarget).find('.select-row-cell:last');
|
||||
|
||||
let firstWizardHeaderButton = $(wizardHeader).find('button:enabled:first');
|
||||
let lastWizardHeaderButton = $(wizardHeader).find('button:enabled:last');
|
||||
let lastWizardFooterBtn = $(wizardFooter).find('button:enabled:last');
|
||||
let firstWizardFooterBtn = $(wizardFooter).find('button:enabled:first');
|
||||
|
||||
|
||||
if (event.shiftKey && event.keyCode === 9) {
|
||||
// Move backwards
|
||||
if(firstWizardHeaderButton && $(firstWizardHeaderButton).is($(event.target))) {
|
||||
if (lastWizardFooterBtn) {
|
||||
$(lastWizardFooterBtn).focus();
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
}
|
||||
else if ($(firstWizardFooterBtn).is($(event.target))){
|
||||
if ($(gridElement).find('.custom-control-input').is(':visible')){
|
||||
$(gridElementLast).find('.custom-control-input').focus();
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}else if ($(event.currentTarget).find('.wizard-content').find('.CodeMirror-scroll').is(':visible')){
|
||||
$(lastWizardHeaderButton).focus();
|
||||
}
|
||||
}
|
||||
} else if (event.keyCode === 9) {
|
||||
// Move forwards
|
||||
// If taget is last button then goto first element
|
||||
if(lastWizardFooterBtn && $(lastWizardFooterBtn).is($(event.target))) {
|
||||
$(firstWizardHeaderButton).focus();
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}else if (event.target.innerText == 'Name'){
|
||||
if ($(gridElement).find('.custom-control-input').is(':visible')){
|
||||
$(gridElement).find('.custom-control-input').focus();
|
||||
}else {
|
||||
$(firstWizardFooterBtn).focus();
|
||||
}
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
} else if(event.target.tagName == 'DIV') {
|
||||
$(event.currentTarget).find('.custom-control-input:first').trigger('focus');
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
} else if(event.target.tagName == 'TEXTAREA'){
|
||||
$(firstWizardFooterBtn).focus();
|
||||
}
|
||||
} else if (event.keyCode === 27){
|
||||
//close the wizard when esc key is pressed
|
||||
$(wizardHeader).find('button.ajs-close').click();
|
||||
}
|
||||
commonUtils.handleKeyNavigation(event);
|
||||
},
|
||||
enableDisableNext: function(disable) {
|
||||
if (typeof(disable) != 'undefined') {
|
||||
|
||||
Reference in New Issue
Block a user