mirror of
https://github.com/google/blockly.git
synced 2026-01-08 17:40:09 +01:00
Remove unnnecessary aria-selected attributes.
This commit is contained in:
@@ -29,23 +29,23 @@ blocklyApp.FieldComponent = ng.core
|
||||
selector: 'blockly-field',
|
||||
template: `
|
||||
<li [id]="idMap['listItem']" role="treeitem" *ngIf="isTextInput()"
|
||||
[attr.aria-level]="level" aria-selected="false">
|
||||
[attr.aria-level]="level">
|
||||
<input [id]="idMap['input']" [ngModel]="field.getValue()" (ngModelChange)="field.setValue($event)"
|
||||
[disabled]="disabled" type="text" aria-label="string">
|
||||
</li>
|
||||
<li [id]="idMap['listItem']" role="treeitem" *ngIf="isNumberInput()"
|
||||
[attr.aria-level]="level" aria-selected="false">
|
||||
[attr.aria-level]="level">
|
||||
<input [id]="idMap['input']" [ngModel]="field.getValue()" (ngModelChange)="field.setValue($event)"
|
||||
[disabled]="disabled" type="number" aria-label="number">
|
||||
</li>
|
||||
<li [id]="idMap['listItem']" role="treeitem" *ngIf="isDropdown()"
|
||||
[attr.aria-labelledBy]="generateAriaLabelledByAttr('blockly-argument-menu', idMap['label'])"
|
||||
[attr.aria-level]="level" aria-selected="false">
|
||||
[attr.aria-level]="level">
|
||||
<label [id]="idMap['label']">{{'CURRENT_ARGUMENT_VALUE'|translate}} {{field.getText()}}</label>
|
||||
<ol role="group">
|
||||
<li [id]="idMap[optionValue]" role="treeitem" *ngFor="#optionValue of getOptions()"
|
||||
[attr.aria-labelledBy]="generateAriaLabelledByAttr(idMap[optionValue + 'Button'], 'blockly-button')"
|
||||
[attr.aria-level]="level + 1" aria-selected="false">
|
||||
[attr.aria-level]="level + 1">
|
||||
<button [id]="idMap[optionValue + 'Button']" (click)="handleDropdownChange(field, optionValue)"
|
||||
[disabled]="disabled">
|
||||
{{optionText[optionValue]}}
|
||||
@@ -54,12 +54,12 @@ blocklyApp.FieldComponent = ng.core
|
||||
</ol>
|
||||
</li>
|
||||
<li [id]="idMap['listItem']" role="treeitem" *ngIf="isCheckbox()"
|
||||
[attr.aria-level]="level" aria-selected="false">
|
||||
[attr.aria-level]="level">
|
||||
// Checkboxes are not currently supported.
|
||||
</li>
|
||||
<li [id]="idMap['listItem']" role="treeitem" *ngIf="isTextField() && hasVisibleText()"
|
||||
[attr.aria-labelledBy]="utilsService.generateAriaLabelledByAttr('blockly-argument-text', idMap['label'])"
|
||||
[attr.aria-level]="level" aria-selected="false">
|
||||
[attr.aria-level]="level">
|
||||
<label [id]="idMap['label']">
|
||||
{{field.getText()}}
|
||||
</label>
|
||||
|
||||
@@ -31,19 +31,18 @@ blocklyApp.ToolboxTreeComponent = ng.core
|
||||
<li #parentList [id]="idMap['parentList']" role="treeitem"
|
||||
[ngClass]="{blocklyHasChildren: displayBlockMenu || block.inputList.length > 0, blocklyActiveDescendant: index == 0 && noCategories}"
|
||||
[attr.aria-labelledBy]="generateAriaLabelledByAttr('blockly-block-summary', idMap['blockSummaryLabel'])"
|
||||
[attr.aria-selected]="index == 0 && tree.getAttribute('aria-activedescendant') == 'blockly-toolbox-tree-node0'"
|
||||
[attr.aria-level]="level">
|
||||
<label #blockSummaryLabel [id]="idMap['blockSummaryLabel']">{{block.toString()}}</label>
|
||||
<ol role="group" *ngIf="displayBlockMenu || block.inputList.length > 0">
|
||||
<li #listItem class="blocklyHasChildren" [id]="idMap['listItem']"
|
||||
[attr.aria-labelledBy]="generateAriaLabelledByAttr('blockly-block-menu', idMap['blockSummaryLabel'])"
|
||||
*ngIf="displayBlockMenu" role="treeitem"
|
||||
aria-selected="false" [attr.aria-level]="level + 1">
|
||||
[attr.aria-level]="level + 1">
|
||||
<label #label [id]="idMap['label']">{{'BLOCK_ACTION_LIST'|translate}}</label>
|
||||
<ol role="group" *ngIf="displayBlockMenu">
|
||||
<li #workspaceCopy [id]="idMap['workspaceCopy']" role="treeitem"
|
||||
[attr.aria-labelledBy]="generateAriaLabelledByAttr(idMap['workspaceCopyButton'], 'blockly-button')"
|
||||
[attr.aria-level]="level + 2" aria-selected="false">
|
||||
[attr.aria-level]="level + 2">
|
||||
<button #workspaceCopyButton [id]="idMap['workspaceCopyButton']"
|
||||
(click)="copyToWorkspace()">
|
||||
{{'COPY_TO_WORKSPACE'|translate}}
|
||||
@@ -51,7 +50,7 @@ blocklyApp.ToolboxTreeComponent = ng.core
|
||||
</li>
|
||||
<li #blockCopy [id]="idMap['blockCopy']" role="treeitem"
|
||||
[attr.aria-labelledBy]="generateAriaLabelledByAttr(idMap['blockCopyButton'], 'blockly-button')"
|
||||
[attr.aria-level]="level + 2" aria-selected="false">
|
||||
[attr.aria-level]="level + 2">
|
||||
<button #blockCopyButton
|
||||
[id]="idMap['blockCopyButton']"
|
||||
(click)="copyToClipboard()">
|
||||
@@ -60,7 +59,7 @@ blocklyApp.ToolboxTreeComponent = ng.core
|
||||
</li>
|
||||
<li #sendToSelected [id]="idMap['sendToSelected']" role="treeitem"
|
||||
[attr.aria-labelledBy]="generateAriaLabelledByAttr(idMap['sendToSelectedButton'], 'blockly-button', !canBeCopiedToMarkedConnection())"
|
||||
[attr.aria-level]="level + 2" aria-selected="false">
|
||||
[attr.aria-level]="level + 2">
|
||||
<button #sendToSelectedButton
|
||||
[id]="idMap['sendToSelectedButton']"
|
||||
(click)="copyToMarkedSpot()"
|
||||
@@ -82,7 +81,7 @@ blocklyApp.ToolboxTreeComponent = ng.core
|
||||
<li #listItem1 [id]="idMap['listItem' + i]" role="treeitem"
|
||||
*ngIf="inputBlock.connection && !inputBlock.connection.targetBlock()"
|
||||
[attr.aria-labelledBy]="generateAriaLabelledByAttr('blockly-argument-text', idMap['listItem' + i + 'Label'])"
|
||||
[attr.aria-level]="level + 1" aria-selected="false">
|
||||
[attr.aria-level]="level + 1">
|
||||
<!--TODO(madeeha): i18n here will need to happen in a different way due to the way grammar changes based on language.-->
|
||||
<label #label [id]="idMap['listItem' + i + 'Label']">
|
||||
{{utilsService.getInputTypeLabel(inputBlock.connection)}}
|
||||
|
||||
@@ -39,7 +39,7 @@ blocklyApp.ToolboxComponent = ng.core
|
||||
[id]="idMap['Parent' + i]" role="treeitem"
|
||||
[ngClass]="{blocklyHasChildren: true, blocklyActiveDescendant: tree.getAttribute('aria-activedescendant') == idMap['Parent' + i]}"
|
||||
*ngFor="#category of toolboxCategories; #i=index"
|
||||
aria-level="1" aria-selected="false"
|
||||
aria-level="1"
|
||||
[attr.aria-label]="category.attributes.name.value">
|
||||
<div *ngIf="category && category.attributes">
|
||||
<label [id]="idMap['Label' + i]" #name>
|
||||
|
||||
@@ -107,13 +107,11 @@ blocklyApp.TreeService = ng.core
|
||||
var activeDesc = document.getElementById(activeDescId);
|
||||
if (activeDesc) {
|
||||
activeDesc.classList.remove('blocklyActiveDescendant');
|
||||
activeDesc.setAttribute('aria-selected', 'false');
|
||||
}
|
||||
},
|
||||
markActiveDesc_: function(activeDescId) {
|
||||
var newActiveDesc = document.getElementById(activeDescId);
|
||||
newActiveDesc.classList.add('blocklyActiveDescendant');
|
||||
newActiveDesc.setAttribute('aria-selected', 'true');
|
||||
},
|
||||
// Runs the given function while preserving the focus and active descendant
|
||||
// for the given tree.
|
||||
|
||||
@@ -30,19 +30,19 @@ blocklyApp.WorkspaceTreeComponent = ng.core
|
||||
template: `
|
||||
<li [id]="idMap['blockRoot']" role="treeitem" class="blocklyHasChildren"
|
||||
[attr.aria-labelledBy]="generateAriaLabelledByAttr('blockly-block-summary', idMap['blockSummary'])"
|
||||
[attr.aria-level]="level" aria-selected="false">
|
||||
[attr.aria-level]="level">
|
||||
<label [id]="idMap['blockSummary']">{{block.toString()}}</label>
|
||||
|
||||
<ol role="group">
|
||||
<li [id]="idMap['listItem']" class="blocklyHasChildren" role="treeitem"
|
||||
[attr.aria-labelledBy]="generateAriaLabelledByAttr('blockly-block-menu', idMap['blockSummary'])"
|
||||
[attr.aria-level]="level + 1" aria-selected="false">
|
||||
[attr.aria-level]="level + 1">
|
||||
<label [id]="idMap['label']">{{'BLOCK_ACTION_LIST'|translate}}</label>
|
||||
<ol role="group">
|
||||
<li *ngFor="#buttonInfo of actionButtonsInfo"
|
||||
[id]="idMap[buttonInfo.baseIdKey]" role="treeitem"
|
||||
[attr.aria-labelledBy]="generateAriaLabelledByAttr(idMap[buttonInfo.baseIdKey + 'Button'], 'blockly-button', buttonInfo.isDisabled())"
|
||||
[attr.aria-level]="level + 2" aria-selected="false">
|
||||
[attr.aria-level]="level + 2">
|
||||
<button [id]="idMap[buttonInfo.baseIdKey + 'Button']" (click)="buttonInfo.action()"
|
||||
[disabled]="buttonInfo.isDisabled()">
|
||||
{{buttonInfo.translationIdForText|translate}}
|
||||
@@ -65,7 +65,7 @@ blocklyApp.WorkspaceTreeComponent = ng.core
|
||||
<ol role="group">
|
||||
<li [id]="idMap['markSpot' + i]" role="treeitem" *ngFor="#fieldButtonInfo of fieldButtonsInfo"
|
||||
[attr.aria-labelledBy]="generateAriaLabelledByAttr(idMap[fieldButtonInfo.baseIdKey + 'Button'], 'blockly-button', fieldButtonInfo.isDisabled(inputBlock.connection))"
|
||||
[attr.aria-level]="level + 2" aria-selected="false">
|
||||
[attr.aria-level]="level + 2">
|
||||
<button [id]="idMap[fieldButtonInfo.baseIdKey + 'Button']" (click)="fieldButtonInfo.action(inputBlock.connection)">
|
||||
{{fieldButtonInfo.translationIdForText|translate}}
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user