Skip to content

Commit 146ed56

Browse files
committed
fix(datepicker): use narrower value for aria-haspopup
Sets the value of `aria-haspopup` to `dialog` in order to indicate what kind of popup will be opened.
1 parent b72c1b7 commit 146ed56

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/lib/datepicker/datepicker-input.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export class MatDatepickerInputEvent<D> {
7979
{provide: MAT_INPUT_VALUE_ACCESSOR, useExisting: MatDatepickerInput},
8080
],
8181
host: {
82-
'[attr.aria-haspopup]': 'true',
82+
'aria-haspopup': 'dialog',
8383
'[attr.aria-owns]': '(_datepicker?.opened && _datepicker.id) || null',
8484
'[attr.min]': 'min ? _dateAdapter.toIso8601(min) : null',
8585
'[attr.max]': 'max ? _dateAdapter.toIso8601(max) : null',

src/lib/datepicker/datepicker-toggle.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#button
33
mat-icon-button
44
type="button"
5-
aria-haspopup="true"
5+
aria-haspopup="dialog"
66
[attr.aria-label]="_intl.openCalendarLabel"
77
[attr.tabindex]="disabled ? -1 : tabIndex"
88
[disabled]="disabled"

src/lib/datepicker/datepicker.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ describe('MatDatepicker', () => {
898898
const button = fixture.debugElement.query(By.css('button'));
899899

900900
expect(button).toBeTruthy();
901-
expect(button.nativeElement.getAttribute('aria-haspopup')).toBe('true');
901+
expect(button.nativeElement.getAttribute('aria-haspopup')).toBe('dialog');
902902
});
903903

904904
it('should open calendar when toggle clicked', () => {

0 commit comments

Comments
 (0)