Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 197d197

Browse files
Splaktarmmalerba
authored andcommitted
fix(datepicker): remove invalid aria-expanded (#11740)
use ARIA 1.1 value for `aria-has-popup` Relates to #11475
1 parent ec64de3 commit 197d197

File tree

2 files changed

+5
-22
lines changed

2 files changed

+5
-22
lines changed

src/components/datepicker/js/datepickerDirective.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@
109109
'<input ' +
110110
(ariaLabelValue ? 'aria-label="' + ariaLabelValue + '" ' : '') +
111111
'class="md-datepicker-input" ' +
112-
'aria-haspopup="true" ' +
113-
'aria-expanded="{{ctrl.isCalendarOpen}}" ' +
112+
'aria-haspopup="dialog" ' +
114113
'ng-focus="ctrl.setFocused(true)" ' +
115114
'ng-blur="ctrl.setFocused(false)"> ' +
116115
triangleButton +
@@ -325,7 +324,7 @@
325324
this.isFocused = false;
326325

327326
/** @type {boolean} */
328-
this.isDisabled;
327+
this.isDisabled = undefined;
329328
this.setDisabled($element[0].disabled || angular.isString($attrs.disabled));
330329

331330
/** @type {boolean} Whether the date-picker's calendar pane is open. */
@@ -334,7 +333,7 @@
334333
/** @type {boolean} Whether the calendar should open when the input is focused. */
335334
this.openOnFocus = $attrs.hasOwnProperty('mdOpenOnFocus');
336335

337-
/** @final */
336+
/** @type {Object} Instance of the mdInputContainer controller */
338337
this.mdInputContainer = null;
339338

340339
/**
@@ -648,9 +647,9 @@
648647
};
649648

650649
/**
651-
* Check to see if the input is valid as the validation should fail if the model is invalid
650+
* Check to see if the input is valid, as the validation should fail if the model is invalid.
652651
*
653-
* @param {String} inputString
652+
* @param {string} inputString
654653
* @param {Date} parsedDate
655654
* @return {boolean} Whether the input is valid
656655
*/

src/components/datepicker/js/datepickerDirective.spec.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -851,22 +851,6 @@ describe('md-datepicker', function() {
851851
expect(controller.calendarPane.id).toBe(ariaAttr);
852852
});
853853

854-
it('should toggle the aria-expanded value', function() {
855-
expect(controller.ngInputElement.attr('aria-expanded')).toBe('false');
856-
857-
controller.openCalendarPane({
858-
target: controller.inputElement
859-
});
860-
scope.$apply();
861-
862-
expect(controller.ngInputElement.attr('aria-expanded')).toBe('true');
863-
864-
controller.closeCalendarPane();
865-
scope.$apply();
866-
867-
expect(controller.ngInputElement.attr('aria-expanded')).toBe('false');
868-
});
869-
870854
describe('tabindex behavior', function() {
871855
beforeEach(function() {
872856
ngElement && ngElement.remove();

0 commit comments

Comments
 (0)