[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'.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user