Skip to content

Commit 1cb6f0f

Browse files
committed
feat(aria/toolbar): adds disabled radio options to toolbar basic examples
Updates toolbar basic horizontal example and toolbar basic vertical example to both have a disabled radio option for accessibility testing.
1 parent 5396c43 commit 1cb6f0f

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

src/components-examples/aria/toolbar/toolbar-basic-horizontal/toolbar-basic-horizontal-example.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@
2727
aria-label="Select text alignment"
2828
>
2929
@for (alignment of alignments; track alignment) {
30-
<li ngRadioButton [value]="alignment.value" class="example-radio-button">
30+
<li
31+
ngRadioButton
32+
[value]="alignment.value"
33+
[disabled]="disabledOptions.includes(alignment.value)"
34+
class="example-radio-button">
3135
<span class="example-radio-indicator"></span>
3236
<span>{{ alignment.label }}</span>
3337
</li>

src/components-examples/aria/toolbar/toolbar-basic-horizontal/toolbar-basic-horizontal-example.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,15 @@ export class ToolbarBasicHorizontalExample {
1717
{value: 'center', label: 'Center'},
1818
{value: 'right', label: 'Right'},
1919
];
20+
21+
// Control for which radio options are individually disabled
22+
disabledOptions: string[] = ['center'];
23+
2024
format(tool: string) {
2125
console.log(`Tool activated: ${tool}`);
2226
this._liveAnnouncer.announce(`${tool} applied`, 'polite');
2327
}
28+
2429
test(action: string) {
2530
console.log(`Action triggered: ${action}`);
2631
this._liveAnnouncer.announce(`${action} button activated`, 'polite');

src/components-examples/aria/toolbar/toolbar-basic-vertical/toolbar-basic-vertical-example.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@
2727
aria-label="Select text alignment"
2828
>
2929
@for (alignment of alignments; track alignment) {
30-
<li ngRadioButton [value]="alignment.value" class="example-radio-button">
30+
<li
31+
ngRadioButton
32+
[value]="alignment.value"
33+
[disabled]="disabledOptions.includes(alignment.value)"
34+
class="example-radio-button">
3135
<span class="example-radio-indicator"></span>
3236
<span>{{ alignment.label }}</span>
3337
</li>

src/components-examples/aria/toolbar/toolbar-basic-vertical/toolbar-basic-vertical-example.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,15 @@ export class ToolbarBasicVerticalExample {
1717
{value: 'center', label: 'Center'},
1818
{value: 'right', label: 'Right'},
1919
];
20+
21+
// Control for which radio options are individually disabled
22+
disabledOptions: string[] = ['center'];
23+
2024
format(tool: string) {
2125
console.log(`Tool activated: ${tool}`);
2226
this._liveAnnouncer.announce(`${tool} applied`, 'polite');
2327
}
28+
2429
test(action: string) {
2530
console.log(`Action triggered: ${action}`);
2631
this._liveAnnouncer.announce(`${action} button activated`, 'polite');

0 commit comments

Comments
 (0)