Skip to content

Commit 3530b38

Browse files
authored
List: prevent extra scrolling on keypress events on "Select All" checkbox (#31602) (#31623)
1 parent 5b9a52c commit 3530b38

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

packages/devextreme/js/__internal/ui/list/m_list.edit.decorator.selection.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ class EditDecoratorSelection extends EditDecorator {
208208

209209
_selectAllHandler(event): DeferredObj<unknown> {
210210
event.stopPropagation();
211+
event.preventDefault(); // to prevent scrolling on space key press
211212
this._list._saveSelectionChangeEvent(event);
212213

213214
const { value } = this._selectAllCheckBox.option();

packages/devextreme/js/__internal/ui/list/m_list.edit.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,13 @@ class ListEdit extends ListBase {
5656
const isInternalMoving = editProvider.handleKeyboardEvents(focusedItemIndex, moveUp);
5757

5858
if (!isInternalMoving) {
59-
moveUp ? parent.upArrow(e) : parent.downArrow(e);
59+
if (moveUp) {
60+
parent.upArrow(e);
61+
} else {
62+
parent.downArrow(e);
63+
}
64+
} else {
65+
e.preventDefault(); // to prevent extra scrolling
6066
}
6167
}
6268
};

0 commit comments

Comments
 (0)