mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-23 01:25:38 -05:00
Fix for auto resize column headers, (#10909)
* Fixed scroll to top * removed brackets * Don't trigger the cellSelectionModel when className is the resizable handler * Added message for header listener Co-authored-by: Amir Omidi <amomidi@microsoft.com>
This commit is contained in:
@@ -482,6 +482,8 @@ export abstract class GridTableBase<T> extends Disposable implements IView {
|
||||
this.table.registerPlugin(new AdditionalKeyBindings());
|
||||
this._register(this.table.onContextMenu(this.contextMenu, this));
|
||||
this._register(this.table.onClick(this.onTableClick, this));
|
||||
//This listener is used for correcting auto-scroling when clicking on the header for reszing.
|
||||
this._register(this.table.onHeaderClick(this.onHeaderClick, this));
|
||||
|
||||
if (this.styles) {
|
||||
this.table.style(this.styles);
|
||||
@@ -580,6 +582,11 @@ export abstract class GridTableBase<T> extends Disposable implements IView {
|
||||
this._state = val;
|
||||
}
|
||||
|
||||
private onHeaderClick(event: ITableMouseEvent) {
|
||||
//header clicks must be accounted for as they force the table to scroll to the top;
|
||||
this.scrolled = false;
|
||||
}
|
||||
|
||||
private onTableClick(event: ITableMouseEvent) {
|
||||
// account for not having the number column
|
||||
let column = this.resultSet.columnInfo[event.cell.cell - 1];
|
||||
|
||||
Reference in New Issue
Block a user