mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed keyboard navigation for Select2 and Privilege cell in Backgrid Fixes #3908
This commit is contained in:
committed by
Akshay Joshi
parent
f731ab730b
commit
ea87d6da8f
@@ -591,11 +591,29 @@ define([
|
||||
this.$el.removeClass('editor');
|
||||
},
|
||||
|
||||
saveOrCancel: function (e) {
|
||||
var model = this.model;
|
||||
var column = this.column;
|
||||
|
||||
var command = new Backgrid.Command(e);
|
||||
var blurred = e.type === 'blur';
|
||||
|
||||
if (command.moveUp() || command.moveDown() || command.moveLeft() || command.moveRight() ||
|
||||
command.save() || blurred) {
|
||||
|
||||
this.exitEditMode();
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
model.trigger('backgrid:edited', model, column, command);
|
||||
}
|
||||
},
|
||||
events: {
|
||||
'select2:open': 'enterEditMode',
|
||||
'select2:close': 'exitEditMode',
|
||||
'change': 'onSave',
|
||||
'select2:unselect': 'onSave',
|
||||
'blur': 'saveOrCancel',
|
||||
'keydown': 'saveOrCancel',
|
||||
},
|
||||
/** @property {function(Object, ?Object=): string} template */
|
||||
template: _.template([
|
||||
|
||||
Reference in New Issue
Block a user