Skip to content

Commit 49ee88e

Browse files
tarusinvalorkin
authored andcommitted
feat(buttons): add aria-attributes (#4082)
Closes #4068
1 parent 6e2e60f commit 49ee88e

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

demo/src/app/components/+buttons/demos/custom-checkbox-value/custom-checkbox-value.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ import { Component } from '@angular/core';
55
templateUrl: './custom-checkbox-value.html'
66
})
77
export class DemoButtonsCustomCheckboxValueComponent {
8-
singleModel: string = '1';
8+
singleModel = '1';
99
}

demo/src/ng-api-doc.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,13 @@ export const ngdoc: any = {
151151
{
152152
"name": "btnCheckboxFalse",
153153
"defaultValue": "false",
154-
"type": "any",
154+
"type": "boolean",
155155
"description": "<p>Falsy value, will be set to ngModel </p>\n"
156156
},
157157
{
158158
"name": "btnCheckboxTrue",
159159
"defaultValue": "true",
160-
"type": "any",
160+
"type": "boolean",
161161
"description": "<p>Truthy value, will be set to ngModel </p>\n"
162162
}
163163
],

src/buttons/button-checkbox.directive.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ export class ButtonCheckboxDirective implements ControlValueAccessor, OnInit {
3030
/** Falsy value, will be set to ngModel */
3131
@Input() btnCheckboxFalse: any = false;
3232

33-
@HostBinding('class.active') state = false;
33+
@HostBinding('class.active')
34+
@HostBinding('attr.aria-pressed')
35+
state = false;
3436

3537
protected value: any;
3638
protected isDisabled: boolean;

src/buttons/button-radio.directive.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export class ButtonRadioDirective implements ControlValueAccessor, OnInit {
5454
}
5555

5656
@HostBinding('class.active')
57+
@HostBinding('attr.aria-pressed')
5758
get isActive(): boolean {
5859
return this.btnRadio === this.value;
5960
}

0 commit comments

Comments
 (0)