From 1fa67917ba648bc15f5a895f6bdcea173e2a7258 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Thu, 15 Jun 2017 14:09:11 +0200 Subject: [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. --- addons/web/static/src/js/fields/basic_fields.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'addons/web/static/src/js/fields/basic_fields.js') 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); }, -- cgit v1.2.3