Skip to content

Commit

Permalink
#7236 scroll by page when focused cell is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariusz Jurowicz committed Apr 26, 2018
1 parent 63eb614 commit e81fe56
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions js/notebook/src/tableDisplay/dataGrid/BeakerXDataGrid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import ColumnPosition from "./column/ColumnPosition";
import {SectionList} from "@phosphor/datagrid/lib/sectionlist";
import ColumnRegion = DataModel.ColumnRegion;
import {DataGridResize} from "./DataGridResize";
import {KEYBOARD_KEYS} from "./event/enums";

export class BeakerXDataGrid extends DataGrid {
id: string;
Expand Down
6 changes: 5 additions & 1 deletion js/notebook/src/tableDisplay/dataGrid/event/EventManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,11 @@ export default class EventManager {
return;
}

this.dataGrid.cellFocusManager.setFocusedCellByNavigationKey(code);
if (this.dataGrid.cellFocusManager.focusedCellData) {
this.dataGrid.cellFocusManager.setFocusedCellByNavigationKey(code);
} else if (code === KEYBOARD_KEYS.PageDown || code === KEYBOARD_KEYS.PageUp) {
this.dataGrid.scrollByPage(code === KEYBOARD_KEYS.PageUp ? 'up' : 'down');
}

if (event.shiftKey) {
this.dataGrid.cellSelectionManager.setEndCell(
Expand Down

0 comments on commit e81fe56

Please sign in to comment.