[FIX] web: allow focus to move to a field monetary
In the chart of account editor, which is an editable list with 2 contiguous monetary field, we could not change the first then move to the second using the TAB key: the focus was not set on the input of the second monetary field, and when it is, that input is destroyed and recreated so the focus was lost Before this fix, the user needed to hit TAB twice to move to the next field. After this fix, the user can navigate between fields monerary with TAB
This commit is contained in:
@@ -622,7 +622,7 @@ var FieldMonetary = InputField.extend({
|
||||
this.$el.empty();
|
||||
|
||||
// Prepare and add the input
|
||||
this._prepareInput().appendTo(this.$el);
|
||||
this._prepareInput(this.$input).appendTo(this.$el);
|
||||
|
||||
if (this.currency) {
|
||||
// Prepare and add the currency symbol
|
||||
|
||||
@@ -2401,7 +2401,7 @@ QUnit.module('Views', {
|
||||
|
||||
// Press 'Tab' -> should go to next line
|
||||
// add a value in the cell because the Tab on an empty first cell would activate the next widget in the view
|
||||
list.$('.o_selected_row input').val(11).trigger('input');
|
||||
list.$('.o_selected_row input').val(11).trigger('input');
|
||||
list.$('.o_selected_row input').trigger({type: 'keydown', which: 9});
|
||||
assert.ok(list.$('.o_data_row:nth(3)').hasClass('o_selected_row'),
|
||||
"fourth row should be in edition");
|
||||
|
||||
Reference in New Issue
Block a user