diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-09-23 17:40:06 +0000 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-09-24 09:44:56 +0000 |
| commit | ac4fc6e7c7d71c3f8e2440a8ed8095c5aab15dd8 (patch) | |
| tree | e143d6d261f22cb06f2c0d5b344a4353e5b3be1b /addons/web/static/src/js/fields/abstract_field.js | |
| parent | a6a3df3d0eda0fc2476c59de61d59534815f7c20 (diff) | |
| parent | bd3e510edbcd62f508dae28f573ee4d1a51bcf87 (diff) | |
[MERGE] forward port branch saas-12.3 up to bd3e510edbc
closes odoo/odoo#37314
Signed-off-by: Christophe Simonis <chs@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/fields/abstract_field.js')
| -rw-r--r-- | addons/web/static/src/js/fields/abstract_field.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/addons/web/static/src/js/fields/abstract_field.js b/addons/web/static/src/js/fields/abstract_field.js index dc456d21ae0..317ea30e0ad 100644 --- a/addons/web/static/src/js/fields/abstract_field.js +++ b/addons/web/static/src/js/fields/abstract_field.js @@ -533,6 +533,12 @@ var AbstractField = Widget.extend({ } break; case $.ui.keyCode.ENTER: + // We preventDefault the ENTER key because of two coexisting behaviours: + // - In HTML5, pressing ENTER on a <button> triggers two events: a 'keydown' AND a 'click' + // - When creating and opening a dialog, the focus is automatically given to the primary button + // The end result caused some issues where a modal opened by an ENTER keypress (e.g. saving + // changes in multiple edition) confirmed the modal without any intentionnal user input. + ev.preventDefault(); ev.stopPropagation(); this.trigger_up('navigation_move', {direction: 'next_line'}); break; |
