diff options
| author | Aaron Bohy <aab@odoo.com> | 2017-06-15 14:09:11 +0200 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2017-06-16 08:00:24 +0200 |
| commit | 1fa67917ba648bc15f5a895f6bdcea173e2a7258 (patch) | |
| tree | dc52bb7adc6c5fb60cebfb3dd0eb83913899a20c /addons/web/static/src/js/fields/basic_fields.js | |
| parent | f4200f376bbd90e919073100170853ada4ad71fc (diff) | |
[FIX] web: allow to move cursor in inputs with arrows
Commit 9966e4b added calls to preventDefault() on the keydown event
for left, right, up and down arrows, to prevent the page from
scrolling. However, it also prevents the cursor from moving inside
the inputs. Since the initial issue only concerned checkboxes, this
rev. moves the preventDefault() calls from AbstractField to
FieldBoolean.
Diffstat (limited to 'addons/web/static/src/js/fields/basic_fields.js')
| -rw-r--r-- | addons/web/static/src/js/fields/basic_fields.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index d4013a8bcdb..ffe7d7c0f99 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -686,6 +686,11 @@ var FieldBoolean = AbstractField.extend({ this.$input.prop('checked', !this.value); this._setValue(!this.value); return; + case $.ui.keyCode.UP: + case $.ui.keyCode.RIGHT: + case $.ui.keyCode.DOWN: + case $.ui.keyCode.LEFT: + ev.preventDefault(); } this._super.apply(this, arguments); }, |
