fix(grid): Arrow key nav minor enhancements (#8762)

fix(grid): Arrow key nav minor enhancements
This commit is contained in:
Suraj Shetty 2019-11-12 12:33:07 +05:30 committed by GitHub
commit 766eb4cc1f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -426,14 +426,11 @@ export default class GridRow {
var fieldtype = $(this).attr('data-fieldtype');
var move_up_down = function(base) {
if (in_list(['Text', 'Small Text'], fieldtype)) {
return;
if (in_list(['Text', 'Small Text', 'Code', 'Text Editor', 'HTML Editor'], fieldtype) && !e.altKey) {
return false;
}
if (field.autocomplete_open) {
return;
}
if (field.autocomplete_open) {
return;
return false;
}
base.toggle_editable_row();
@ -441,7 +438,7 @@ export default class GridRow {
if (input) {
input.focus();
}
return true;
};
// TAB
@ -467,14 +464,16 @@ export default class GridRow {
} else if (e.which === UP_ARROW) {
if (me.doc.idx > 1) {
var prev = me.grid.grid_rows[me.doc.idx-2];
move_up_down(prev);
return false;
if (move_up_down(prev)) {
return false;
}
}
} else if (e.which === DOWN_ARROW) {
if (me.doc.idx < values.length) {
var next = me.grid.grid_rows[me.doc.idx];
move_up_down(next);
return false;
if (move_up_down(next)) {
return false;
}
}
}
@ -653,4 +652,4 @@ export default class GridRow {
toggle_editable(fieldname, editable) {
this.set_field_property(fieldname, 'read_only', editable ? 0 : 1);
}
};
};