mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-18 09:35:39 -05:00
fire selection event when re-entered (#14857)
This commit is contained in:
@@ -42,6 +42,13 @@ export default class DeclarativeTableComponent extends ContainerBase<any, azdata
|
||||
private _colorTheme: IColorTheme;
|
||||
private _hasFocus: boolean;
|
||||
|
||||
/**
|
||||
* The flag is set to true when the table gains focus. When a row is selected and the flag is true the row selected event will
|
||||
* fire regardless whether the row is already selected.
|
||||
*
|
||||
*/
|
||||
private _rowSelectionFocusFlag: boolean = false;
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) changeRef: ChangeDetectorRef,
|
||||
@Inject(forwardRef(() => ElementRef)) el: ElementRef,
|
||||
@@ -309,8 +316,9 @@ export default class DeclarativeTableComponent extends ContainerBase<any, azdata
|
||||
if (!this.enableRowSelection) {
|
||||
return;
|
||||
}
|
||||
if (!this.isRowSelected(row)) {
|
||||
if (this._rowSelectionFocusFlag || !this.isRowSelected(row)) {
|
||||
this._selectedRow = row;
|
||||
this._rowSelectionFocusFlag = false;
|
||||
this._changeRef.detectChanges();
|
||||
|
||||
this.fireEvent({
|
||||
@@ -370,6 +378,7 @@ export default class DeclarativeTableComponent extends ContainerBase<any, azdata
|
||||
|
||||
onFocusIn() {
|
||||
this._hasFocus = true;
|
||||
this._rowSelectionFocusFlag = true;
|
||||
this._changeRef.detectChanges();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user