From 9966e4b333f6f360da7878d087fa226135d8f61d Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Thu, 1 Jun 2017 13:00:07 +0200 Subject: [PATCH] [FIX] web: don't scroll when navigating in editable list Problem occured with checkboxes in editable lists: when pressing up, down, right or left with the focus on a checkbox, in addition to navigating in the requested direction in the list, the page scrolled (if there was a scrollbar of course). This was because the event wasn't 'preventDefaulted'. --- addons/web/static/src/js/fields/abstract_field.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/web/static/src/js/fields/abstract_field.js b/addons/web/static/src/js/fields/abstract_field.js index d09174b2b20..5908f7f5a8b 100644 --- a/addons/web/static/src/js/fields/abstract_field.js +++ b/addons/web/static/src/js/fields/abstract_field.js @@ -412,18 +412,22 @@ var AbstractField = Widget.extend({ this.trigger_up('navigation_move', {direction: 'cancel'}); break; case $.ui.keyCode.UP: + ev.preventDefault(); ev.stopPropagation(); this.trigger_up('navigation_move', {direction: 'up'}); break; case $.ui.keyCode.RIGHT: + ev.preventDefault(); ev.stopPropagation(); this.trigger_up('navigation_move', {direction: 'right'}); break; case $.ui.keyCode.DOWN: + ev.preventDefault(); ev.stopPropagation(); this.trigger_up('navigation_move', {direction: 'down'}); break; case $.ui.keyCode.LEFT: + ev.preventDefault(); ev.stopPropagation(); this.trigger_up('navigation_move', {direction: 'left'}); break;