diff options
| author | Hardik Prajapati <hap@odoo.com> | 2020-08-05 13:10:26 +0000 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2020-09-16 08:26:26 +0000 |
| commit | 450e0ec45005c3d6c2e8475e134113a7d8515e9f (patch) | |
| tree | 579d8b6d0b03f6a44e98e25fb3fcdb8bdccdc63c /addons/web/static/src/js | |
| parent | db559a7678e81a8151a94f3f0a8311b628bc8d36 (diff) | |
[FIX] web: prevent dropdown closing on mouseup
Before this commit, selecting the whole content of the custom filter
input and releasing the cursor outside of the dropdown closed the
dropdown.
With this commit, the dropdown is kept open in this situation.
task - 2276544
closes odoo/odoo#55660
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
Diffstat (limited to 'addons/web/static/src/js')
| -rw-r--r-- | addons/web/static/src/js/components/dropdown_menu.js | 6 | ||||
| -rw-r--r-- | addons/web/static/src/js/components/dropdown_menu_item.js | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/addons/web/static/src/js/components/dropdown_menu.js b/addons/web/static/src/js/components/dropdown_menu.js index c536f3caba7..64c30b6500e 100644 --- a/addons/web/static/src/js/components/dropdown_menu.js +++ b/addons/web/static/src/js/components/dropdown_menu.js @@ -121,7 +121,11 @@ odoo.define('web.DropdownMenu', function (require) { * @param {MouseEvent} ev */ _onWindowClick(ev) { - if (this.state.open && !this.el.contains(ev.target)) { + if ( + this.state.open && + !this.el.contains(ev.target) && + !this.el.contains(document.activeElement) + ) { this.state.open = false; } } diff --git a/addons/web/static/src/js/components/dropdown_menu_item.js b/addons/web/static/src/js/components/dropdown_menu_item.js index bc028e17719..bcc54ab4ffb 100644 --- a/addons/web/static/src/js/components/dropdown_menu_item.js +++ b/addons/web/static/src/js/components/dropdown_menu_item.js @@ -86,7 +86,11 @@ odoo.define('web.DropdownMenuItem', function (require) { * @param {MouseEvent} ev */ _onWindowClick(ev) { - if (this.state.open && !this.el.contains(ev.target)) { + if ( + this.state.open && + !this.el.contains(ev.target) && + !this.el.contains(document.activeElement) + ) { this.state.open = false; } } |
