mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-27 09:35:37 -05:00
select cell after keyboard navigation (#21366)
* sync selected cell and active cell * more packages
This commit is contained in:
@@ -45,6 +45,7 @@ export class CellSelectionModel<T> implements Slick.SelectionModel<T, Array<Slic
|
||||
public init(grid: Slick.Grid<T>) {
|
||||
this.grid = grid;
|
||||
this._handler.subscribe(this.grid.onKeyDown, (e: DOMEvent) => this.handleKeyDown(e as KeyboardEvent));
|
||||
this._handler.subscribe(this.grid.onAfterKeyboardNavigation, (e: Event) => this.handleAfterKeyboardNavigationEvent());
|
||||
this._handler.subscribe(this.grid.onClick, (e: DOMEvent, args: Slick.OnClickEventArgs<T>) => this.handleCellClick(e as MouseEvent, args));
|
||||
this._handler.subscribe(this.grid.onHeaderClick, (e: DOMEvent, args: Slick.OnHeaderClickEventArgs<T>) => this.handleHeaderClick(e as MouseEvent, args));
|
||||
this.grid.registerPlugin(this.selector);
|
||||
@@ -334,4 +335,11 @@ export class CellSelectionModel<T> implements Slick.SelectionModel<T, Array<Slic
|
||||
e.stopPropagation();
|
||||
}
|
||||
}
|
||||
|
||||
private handleAfterKeyboardNavigationEvent(): void {
|
||||
const activeCell = this.grid.getActiveCell();
|
||||
if (activeCell) {
|
||||
this.setSelectedRanges([new Slick.Range(activeCell.row, activeCell.cell)]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user