diff options
| author | jvm-odoo <jvm@odoo.com> | 2020-04-30 08:09:49 +0000 |
|---|---|---|
| committer | jvm-odoo <jvm@odoo.com> | 2020-04-30 14:35:08 +0000 |
| commit | a7ee8bc79b184b07793ada7670f677fcac959a07 (patch) | |
| tree | 169713184ea3a86aecb5f060e77f20e9305c9e54 /addons/web/static | |
| parent | f1fcc805742c7cf3c125afd98c74a81340b67c67 (diff) | |
[FIX] web: fix can't open date picker on graph views
Issue
- Install CRM
- CRM > Reports > Activities
- Add a custom filter > Created on
- Select the date
You can't, the date picker is not shown
Cause
Actually, the date picker is shown but
very quickly and it is closed by a scroll
event thrown by Chart.js.
Solution
Close the date picker only if the user
scrolls manually.
OPW-2245019
closes odoo/odoo#50482
X-original-commit: bda320052ac937f5bc17c7da81d84633d72a8370
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
Diffstat (limited to 'addons/web/static')
| -rw-r--r-- | addons/web/static/src/js/widgets/date_picker.js | 6 | ||||
| -rw-r--r-- | addons/web/static/tests/fields/basic_fields_tests.js | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/addons/web/static/src/js/widgets/date_picker.js b/addons/web/static/src/js/widgets/date_picker.js index ecd29e2e0be..9ebd68813ee 100644 --- a/addons/web/static/src/js/widgets/date_picker.js +++ b/addons/web/static/src/js/widgets/date_picker.js @@ -75,7 +75,7 @@ var DateWidget = Widget.extend({ */ destroy: function () { if (this._onScroll) { - window.removeEventListener('scroll', this._onScroll, true); + window.removeEventListener('wheel', this._onScroll, true); } this.__libInput++; this.$el.datetimepicker('destroy'); @@ -263,7 +263,7 @@ var DateWidget = Widget.extend({ this.__isOpen = false; this.changeDatetime(); if (this._onScroll) { - window.removeEventListener('scroll', this._onScroll, true); + window.removeEventListener('wheel', this._onScroll, true); } this.changeDatetime(); }, @@ -287,7 +287,7 @@ var DateWidget = Widget.extend({ self.__libInput--; } }; - window.addEventListener('scroll', this._onScroll, true); + window.addEventListener('wheel', this._onScroll, true); }, /** * @private diff --git a/addons/web/static/tests/fields/basic_fields_tests.js b/addons/web/static/tests/fields/basic_fields_tests.js index 5ffd7251216..b04fdda089f 100644 --- a/addons/web/static/tests/fields/basic_fields_tests.js +++ b/addons/web/static/tests/fields/basic_fields_tests.js @@ -3478,7 +3478,7 @@ QUnit.module('basic_fields', { assert.containsOnce($('body'), '.bootstrap-datetimepicker-widget', "datepicker should be opened"); - form.el.dispatchEvent(new Event('scroll')); + form.el.dispatchEvent(new Event('wheel')); assert.containsNone($('body'), '.bootstrap-datetimepicker-widget', "datepicker should be closed"); form.destroy(); |
