Files
azuredatastudio/src/sql/workbench/contrib/notebook/browser/notebook.component.html
Maddy 4191ef8aa5 Fix active cell update on tabbing (#18614)
* listen on focus_in of toolbar

* update styles on focus_in

* listen for active cell change on notebook componen

* add tabbing order to textcells

* remove duplicate listener

* clean up

* undo

* remove visible check from cellToolbar

* remove duplicate detectChanges on updateActiveCell

* only update active cell if it's already not

* add aria-label for accessibility

* localize the aria label

* refactor

* add cellLabel property to CellModel

* remove updateActiveCell from code component

* regression from merge fix

* set edit mode as true when focusing on cell

* moce check to model

* merge changes correctly

* update edit mode if code cell

* fixes

Co-authored-by: barbaravaldez <bavaldez@microsoft.com>
Co-authored-by: chgagnon <chgagnon@microsoft.com>
2022-04-08 12:31:30 -07:00

28 lines
1.7 KiB
HTML

<!--
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
-->
<div style="overflow: hidden; width: 100%; height: 100%; display: flex; flex-flow: column">
<div #toolbar class="editor-toolbar actionbar-container" style="flex: 0 0 auto; display: flex; flex-flow: row; width: 100%; align-items: center;">
</div>
<div #container class="scrollable" style="flex: 1 1 auto; position: relative; outline: none" (click)="clickOffCell($event)" (scroll)="scrollHandler($event)">
<div *ngFor="let cell of cells">
<div id="{{ cell.id }}" class="notebook-cell" (click)="clickOnCell(cell, $event)" [class.active]="cell.active" (focus)="updateActiveCell(cell)" tabindex="0" attr.aria-label="{{ cell.cellLabel }}">
<cell-toolbar-component *ngIf="cell.active" [cellModel]="cell" [model]="model"></cell-toolbar-component>
<code-cell-component *ngIf="cell.cellType === 'code'" [cellModel]="cell" [model]="model" [activeCellId]="activeCellId">
</code-cell-component>
<text-cell-component *ngIf="cell.cellType === 'markdown'" [cellModel]="cell" [model]="model" [activeCellId]="activeCellId" (dblclick)="enableActiveCellEditIconOnDoubleClick()">
</text-cell-component>
</div>
</div>
<div class="notebook-cell" *ngIf="(!cells || !cells.length) && !isLoading">
<placeholder-cell-component [cellModel]="cell" [model]="model">
</placeholder-cell-component>
</div>
<div class="book-nav" #bookNav [style.visibility]="navigationVisibility">
</div>
</div>
</div>