From f33d5cdb1cb0cc67c2df0957538ff5f3cc6d7742 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 24 Mar 2018 13:52:56 +0100 Subject: [PATCH] Remove all keyBinds from datetimepicker datetimepicker stops the propagation and prevents default for event with key bound even if the handler does nothing. This prevents to have Return to trigger the default submit or Escape to stop list edition. But as datetimepicker uses jQuery.extend to setup the options, we can pass null for keyBinds to remove all the defaults. issue7246 review45301002 --- src/view/form.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/view/form.js b/src/view/form.js index 69b785b48c..cbb29d0886 100644 --- a/src/view/form.js +++ b/src/view/form.js @@ -1471,17 +1471,9 @@ function eval_pyson(value){ }).append(jQuery('', { 'class': 'glyphicon glyphicon-calendar' }))).appendTo(this.date); - var noop = function () {}; - var reset_keyBinds = {}; - var default_keyBinds = this.date.datetimepicker.defaults.keyBinds; - for (var key in default_keyBinds) { - if (default_keyBinds.hasOwnProperty(key)) { - reset_keyBinds[key] = noop; - } - } this.date.datetimepicker({ 'locale': moment.locale(), - 'keyBinds': reset_keyBinds, + 'keyBinds': null, }); this.date.css('width', this._width); this.date.on('dp.change', this.focus_out.bind(this));