mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Notebooks A11Y: Add button role for Placeholder Links (#15851)
* Add button role * Add aria-label * localize aria label
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
<div style="overflow: hidden; width: 100%; height: 100%; display: flex; flex-flow: column">
|
<div style="overflow: hidden; width: 100%; height: 100%; display: flex; flex-flow: column">
|
||||||
<div class="placeholder-cell-component" style="flex: 0 0 auto;">
|
<div class="placeholder-cell-component" style="flex: 0 0 auto;">
|
||||||
<div class="placeholder-cell-component text">
|
<div class="placeholder-cell-component text">
|
||||||
<p>{{clickOn}} <a id="addCode" href="#" (click)="addCell('code', $event)">{{plusCode}}</a> {{or}} <a id="addMarkdown" href="#" (click)="addCell('markdown', $event)">{{plusText}}</a> {{toAddCell}}</p>
|
<p>{{clickOn}} <a id="addCode" href="#" role="button" [attr.aria-label]=plusCodeAriaLabel (click)="addCell('code', $event)">{{plusCode}}</a> {{or}} <a id="addMarkdown" href="#" role="button" [attr.aria-label]=plusTextAriaLabel (click)="addCell('markdown', $event)">{{plusText}}</a> {{toAddCell}}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -68,6 +68,14 @@ export class PlaceholderCellComponent extends CellView implements OnInit, OnChan
|
|||||||
return localize('toAddCell', "to add a code or text cell");
|
return localize('toAddCell', "to add a code or text cell");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get plusCodeAriaLabel(): string {
|
||||||
|
return localize('plusCodeAriaLabel', "Add a code cell");
|
||||||
|
}
|
||||||
|
|
||||||
|
get plusTextAriaLabel(): string {
|
||||||
|
return localize('plusTextAriaLabel', "Add a text cell");
|
||||||
|
}
|
||||||
|
|
||||||
public addCell(cellType: string, event?: Event): void {
|
public addCell(cellType: string, event?: Event): void {
|
||||||
if (event) {
|
if (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|||||||
Reference in New Issue
Block a user