diff options
| author | Samuel Degueldre <sad@odoo.com> | 2020-04-24 08:52:10 +0000 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2020-05-25 08:41:49 +0000 |
| commit | f5e0727ca5d52d97dbe222623102895251fc763a (patch) | |
| tree | e629bf765e50648c29e153147cbc2a99e596ce40 /addons/web/static/tests | |
| parent | 22449613141c5985f68a35d7ba0bc03386f28f96 (diff) | |
[FIX] web, *: fix keyboard overlay staying active when alt-tab/clicking
*: website
The keyboard navigation mixin was initially only used in the web-client,
because of this, some of the logic for hiding the overlay was put inside
of the web-client. We recently made keyboard navigation available on
website [1]. The handlers that would hide the overlay when alt-tabbing
or clicking on the page were not registered. This commit fixes that by
making the keyboard navigation mixin register the overlay-hiding
handlers itself.
[1]: https://github.com/odoo/odoo/commit/0b0690a3934cedcab0d5e34373e8d40c2ab25660
closes odoo/odoo#50122
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Diffstat (limited to 'addons/web/static/tests')
| -rw-r--r-- | addons/web/static/tests/chrome/keyboard_navigation_mixin_tests.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/addons/web/static/tests/chrome/keyboard_navigation_mixin_tests.js b/addons/web/static/tests/chrome/keyboard_navigation_mixin_tests.js index da417deddf5..dcf1c23ce39 100644 --- a/addons/web/static/tests/chrome/keyboard_navigation_mixin_tests.js +++ b/addons/web/static/tests/chrome/keyboard_navigation_mixin_tests.js @@ -15,11 +15,16 @@ QUnit.module('KeyboardNavigationMixin', function () { KeyboardNavigationMixin.init.call(this); }, start: function () { + KeyboardNavigationMixin.start.call(this); var $button = $('<button>').text('Click Me!').attr('accesskey', 'o'); // we need to define the accesskey because it will not be assigned on invisible buttons this.$el.append($button); return this._super.apply(this, arguments); }, + destroy: function () { + KeyboardNavigationMixin.destroy.call(this); + return this._super(...arguments); + }, }); var parent = testUtils.createParent({}); var w = new KeyboardWidget(parent); @@ -51,11 +56,16 @@ QUnit.module('KeyboardNavigationMixin', function () { KeyboardNavigationMixin.init.call(this); }, start: function () { + KeyboardNavigationMixin.start.call(this); $button = $('<button>').text('Click Me!').attr('accesskey', 'o'); // we need to define the accesskey because it will not be assigned on invisible buttons this.$el.append($button); return this._super.apply(this, arguments); }, + destroy: function () { + KeyboardNavigationMixin.destroy.call(this); + return this._super(...arguments); + }, }); var parent = testUtils.createParent({}); var w = new KeyboardWidget(parent); |
