mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
1) Fixed Tab key navigation for Maintenance dialog. Fixes #4227
2) Fix Tab key issue for Toggle switch controls and button on the dialog footer in Safari browser. Fixes #4244
This commit is contained in:
committed by
Akshay Joshi
parent
ed8d1cde00
commit
2cd58efcdd
@@ -591,6 +591,11 @@ define([
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
onshow: function() {
|
||||
var container = $(this.elements.body).find('.tab-content:first > .tab-pane.active:first');
|
||||
commonUtils.findAndSetFocus(container);
|
||||
},
|
||||
},
|
||||
|
||||
prepare: function() {
|
||||
@@ -656,8 +661,6 @@ define([
|
||||
});
|
||||
|
||||
view.$el.attr('tabindex', -1);
|
||||
var container = view.$el.find('.tab-content:first > .tab-pane.active:first');
|
||||
commonUtils.findAndSetFocus(container);
|
||||
setTimeout(function() {
|
||||
pgBrowser.keyboardNavigation.getDialogTabNavigator($(self.elements.dialog));
|
||||
}, 200);
|
||||
|
||||
@@ -76,18 +76,24 @@ define([
|
||||
'<div class="pgadmin-controls col-12 col-sm-8 btn-group pg-maintenance-op pgadmin-controls-radio-none" data-toggle="buttons">',
|
||||
' <% for (var i=0; i < options.length; i++) { %>',
|
||||
' <% var option = options[i]; %>',
|
||||
' <label class="btn btn-primary<% if (i == 0) { %> active<%}%>">',
|
||||
' <label class="btn btn-primary<% if (i == 0) { %> active<%}%>" tabindex="0">',
|
||||
' <input type="radio" name="op" id="op" autocomplete="off" value=<%-formatter.fromRaw(option.value)%><% if (i == 0) { %> selected<%}%> > <%-option.label%>',
|
||||
' </label>',
|
||||
' <% } %>',
|
||||
'</div>',
|
||||
].join('\n')),
|
||||
render: function() {
|
||||
Backform.RadioControl.prototype.render.apply(this, arguments);
|
||||
this.$el.find('.pg-maintenance-op .btn').on('keyup', (e)=>{
|
||||
switch(e.keyCode) {
|
||||
case 32: /* Spacebar click */
|
||||
$(e.currentTarget).trigger('click');
|
||||
break;
|
||||
}
|
||||
});
|
||||
return this;
|
||||
},
|
||||
}),
|
||||
select2: {
|
||||
allowClear: false,
|
||||
width: '100%',
|
||||
placeholder: gettext('Select from list...'),
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'nested',
|
||||
@@ -423,6 +429,10 @@ define([
|
||||
});
|
||||
}
|
||||
},
|
||||
onshow: function() {
|
||||
var container = $(this.elements.body).find('.tab-content:first > .tab-pane.active:first');
|
||||
commonUtils.findAndSetFocus(container);
|
||||
},
|
||||
},
|
||||
prepare: function() {
|
||||
// Main maintenance tool dialog container
|
||||
@@ -466,9 +476,6 @@ define([
|
||||
}
|
||||
|
||||
view.$el.attr('tabindex', -1);
|
||||
var container = view.$el.find('.tab-content:first > .tab-pane.active:first');
|
||||
commonUtils.findAndSetFocus(container);
|
||||
|
||||
this.elements.content.appendChild($container.get(0));
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user