Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(select): add aria-owns property #1898

Merged
merged 1 commit into from
Nov 17, 2016
Merged

fix(select): add aria-owns property #1898

merged 1 commit into from
Nov 17, 2016

Conversation

kara
Copy link
Contributor

@kara kara commented Nov 16, 2016

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Nov 16, 2016
* Option IDs need to be unique across components, so this counter exists outside of
* the component definition.
*/
var _selectOptionCounter = 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about?

/** Unique ID counter for md-option. */
let _uniqueIdCounter = 0;

@@ -291,6 +300,11 @@ export class MdSelect implements AfterContentInit, ControlValueAccessor, OnDestr
this._subscriptions = [];
}

/** Records option IDs to pass to the aria-owns property. */
private _setOptionIds() {
this._optionIds = this.options.map((option) => option.id).join(' ');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: don't need parens around option

expect(selects[0].nativeElement.getAttribute('aria-owns'))
.not.toEqual(selects[1].nativeElement.getAttribute('aria-owns'),
`Expected select components to have unique option IDs in aria-owns attr.`);
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a test where you assert that the aria-owns contains each of the options's IDs. Something like

expect(ariaOwns).toContain(options[0].id);
expect(ariaOwns).toContain(options[1].id);
...

@kara
Copy link
Contributor Author

kara commented Nov 16, 2016

@jelbourn Comments addressed!

@jelbourn
Copy link
Member

LGTM

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker and removed pr: needs review labels Nov 16, 2016
@kara kara merged commit 41ad382 into angular:master Nov 17, 2016
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants