mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Correctly set focus on new Notebook cells after clicking on inline buttons. (#6708)
This commit is contained in:
@@ -11,11 +11,11 @@
|
|||||||
<loading-spinner [loading]="isLoading"></loading-spinner>
|
<loading-spinner [loading]="isLoading"></loading-spinner>
|
||||||
<div class="hoverButtonsContainer" *ngIf="(cells && cells.length > 0) && !isLoading">
|
<div class="hoverButtonsContainer" *ngIf="(cells && cells.length > 0) && !isLoading">
|
||||||
<span class="containerBackground"></span>
|
<span class="containerBackground"></span>
|
||||||
<button class="hoverButton" (click)="addCell('code', 0)">
|
<button class="hoverButton" (click)="addCell('code', 0, $event)">
|
||||||
<div class="addCodeIcon"></div>
|
<div class="addCodeIcon"></div>
|
||||||
<span>{{addCodeLabel}}</span>
|
<span>{{addCodeLabel}}</span>
|
||||||
</button>
|
</button>
|
||||||
<button class="hoverButton" (click)="addCell('markdown', 0)">
|
<button class="hoverButton" (click)="addCell('markdown', 0, $event)">
|
||||||
<div class="addTextIcon"></div>
|
<div class="addTextIcon"></div>
|
||||||
<span>{{addTextLabel}}</span>
|
<span>{{addTextLabel}}</span>
|
||||||
</button>
|
</button>
|
||||||
@@ -29,11 +29,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="hoverButtonsContainer">
|
<div class="hoverButtonsContainer">
|
||||||
<span class="containerBackground"></span>
|
<span class="containerBackground"></span>
|
||||||
<button class="hoverButton" (click)="addCell('code', findCellIndex(cell) + 1)">
|
<button class="hoverButton" (click)="addCell('code', findCellIndex(cell) + 1, $event)">
|
||||||
<div class="addCodeIcon"></div>
|
<div class="addCodeIcon"></div>
|
||||||
<span>{{addCodeLabel}}</span>
|
<span>{{addCodeLabel}}</span>
|
||||||
</button>
|
</button>
|
||||||
<button class="hoverButton" (click)="addCell('markdown', findCellIndex(cell) + 1)">
|
<button class="hoverButton" (click)="addCell('markdown', findCellIndex(cell) + 1, $event)">
|
||||||
<div class="addTextIcon"></div>
|
<div class="addTextIcon"></div>
|
||||||
<span>{{addTextLabel}}</span>
|
<span>{{addTextLabel}}</span>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -200,7 +200,10 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add cell based on cell type
|
// Add cell based on cell type
|
||||||
public addCell(cellType: CellType, index?: number) {
|
public addCell(cellType: CellType, index?: number, event?: Event) {
|
||||||
|
if (event) {
|
||||||
|
event.stopPropagation();
|
||||||
|
}
|
||||||
this._model.addCell(cellType, index);
|
this._model.addCell(cellType, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user