summaryrefslogtreecommitdiff
path: root/addons/web/static/tests/fields/relational_fields_tests.js
diff options
context:
space:
mode:
authorVincent Schippefilt <vsc@odoo.com>2018-09-17 18:10:18 +0200
committerVincent Schippefilt <vsc@odoo.com>2018-09-25 16:49:23 +0200
commit1c3d7c00e0b1cf29cba891d48c1b9df3c4dee6ac (patch)
treee16371825a7e69303c9ce56487e4e397b2481070 /addons/web/static/tests/fields/relational_fields_tests.js
parent48a53f2ea5c5cd225a08b65c90b94e0032c0a776 (diff)
[FIX] web: focus 1st control in editable list on ESC
Before this commit, when we click on the 1st control in an editable list (usually 'Add an item') then press ESCAPE, the focus was not on the 1st control. The intended behaviour is to have the focus on the 1st control, so that we may navigate left/right between controls solely with the keyboard. With this commit, when a cancel keyboard navigation event is triggered in an editable list, it auto-sets the focus on the first control. Co-authored-by: Alexandre Kühn <aku@odoo.com>
Diffstat (limited to 'addons/web/static/tests/fields/relational_fields_tests.js')
-rw-r--r--addons/web/static/tests/fields/relational_fields_tests.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/addons/web/static/tests/fields/relational_fields_tests.js b/addons/web/static/tests/fields/relational_fields_tests.js
index 6af69df2f87..b63b2b25a0c 100644
--- a/addons/web/static/tests/fields/relational_fields_tests.js
+++ b/addons/web/static/tests/fields/relational_fields_tests.js
@@ -13646,6 +13646,12 @@ QUnit.module('relational_fields', {
keyCode: $.ui.keyCode.TAB,
}));
+ // press ESC to cancel 1st control click (create)
+ form.$('.o_data_cell input').trigger($.Event('keydown', {
+ which: $.ui.keyCode.ESCAPE,
+ keyCode: $.ui.keyCode.ESCAPE,
+ }));
+
assert.strictEqual(document.activeElement, form.$('.o_field_x2many_list_row_add a:first')[0],
"first editable list control should now have the focus");