diff options
| author | Aaron Bohy <aab@odoo.com> | 2019-04-11 12:52:35 +0000 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2019-04-12 12:42:02 +0000 |
| commit | a3d98dae68b97aeb7c36ca93c31f067535cbe8fd (patch) | |
| tree | db5fbbde595883263c530089eba0cf919024bd5f /addons/web/static/tests/helpers/test_utils_dom.js | |
| parent | 7bc53ac30ecadbb1e94051edd29c701679cd6de0 (diff) | |
[FIX] web: do not open datepicker on focus
Before this rev., the datepicker was opened when a date(time) field
was focused (e.g. with keyboard navigation). We don't want this
behavior anymore, and we want the datepicker to open only when the
user clicks in the input. This rev. makes this change.
Moreover, this allowed to refined the keyboard navigation (ESC) in
editable list views: when a datepicker is opened, and the user
presses ESC, we close the datepicker, but we keep the row in
edition, whereas before this rev., the row was switched to readonly.
closes odoo/odoo#32408
Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
Diffstat (limited to 'addons/web/static/tests/helpers/test_utils_dom.js')
| -rw-r--r-- | addons/web/static/tests/helpers/test_utils_dom.js | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/addons/web/static/tests/helpers/test_utils_dom.js b/addons/web/static/tests/helpers/test_utils_dom.js index 315a00cbfe7..4c1ef8fbbcc 100644 --- a/addons/web/static/tests/helpers/test_utils_dom.js +++ b/addons/web/static/tests/helpers/test_utils_dom.js @@ -167,15 +167,6 @@ function triggerKeypressEvent(char) { } /** - * Opens the datepicker of a given element. - * - * @param {jQuery} $datepickerEl element to which a datepicker is attached - */ -function openDatepicker($datepickerEl) { - $datepickerEl.find('.o_datepicker_input').trigger('focus.datetimepicker'); -} - -/** * Click on a specified element. If the option first or last is not specified, * this method also check the unicity and the visibility of the target. * @@ -277,6 +268,16 @@ function triggerEvents($el, events) { } +/** + * Opens the datepicker of a given element. + * + * @param {jQuery} $datepickerEl element to which a datepicker is attached + */ +function openDatepicker($datepickerEl) { + click($datepickerEl.find('.o_datepicker_input')); +} + + return { triggerKeypressEvent: triggerKeypressEvent, triggerMouseEvent: triggerMouseEvent, |
