Skip to content

Add accessibility page to demo-app #5748

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

Merged
merged 2 commits into from
Jul 27, 2017
Merged

Conversation

tinayuangao
Copy link
Contributor

  • Add accessibility page in demo-app
  • Can be accessed by /accessibility
  • Add button accessibility demo page (placeholder)

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jul 14, 2017
@tinayuangao tinayuangao requested a review from jelbourn July 14, 2017 00:28
@@ -0,0 +1,36 @@
<md-sidenav-container class="demo-root" fullscreen>
Copy link
Member

Choose a reason for hiding this comment

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

For the a11y demo, I think it would be better to omit the sidenav and just iterate over the <a> elements inside a <nav> at the top of the page. Not pretty, but simple. The sidenav will potentially just complicate the a11y testing, since we want each page to be totally focused on the component under test.

We can also consider adding a skip link at the beginning

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to <nav> with <a> but "skip link" seems not working angular/angular#6595

<button md-button (click)="start.close()">CLOSE</button>
</md-sidenav>
<div>
<md-toolbar color="primary">
Copy link
Member

Choose a reason for hiding this comment

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

I would omit this toolbar and everything in it. These controls are useful for development but are just noise for a11y testing.

Instead of the toolbar we should just have a single <h1> with the title of the specific demo.

</div>
</md-toolbar>

<div #root="dir" dir="ltr" class="demo-content" >
Copy link
Member

Choose a reason for hiding this comment

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

Don't need the dir stuff here

selector: 'accessibility-demo',
templateUrl: './accessibility.html',
host: {
'[class.unicorn-dark-theme]': 'dark',
Copy link
Member

Choose a reason for hiding this comment

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

Don't need a theme for a11y testing


constructor(private _element: ElementRef) {}

toggleFullscreen() {
Copy link
Member

Choose a reason for hiding this comment

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

Don't need the fullscreen stuff

<section>
<button md-button>Check</button>
<button md-raised-button>raised</button>
<button md-fab>
Copy link
Member

Choose a reason for hiding this comment

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

Buttons that just contain icons need an aria-label:

<button md-fab aria-label="Activate floating action style button">
  <md-icon class="md-24">check</md-icon>
 </button>
<button md-mini-fab aria-label="Activate mini floating action style button"> ... </button>

@@ -0,0 +1,23 @@
<div class="demo-button">
Copy link
Member

Choose a reason for hiding this comment

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

I would name the files button-a11y.xx for brevity

<button md-mini-fab>
<md-icon class="md-24">check</md-icon>
</button>
</section>
Copy link
Member

Choose a reason for hiding this comment

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

Also need an example of md-icon-button

</section>

<section>
<a href="http://www.google.com" md-button color="primary">SEARCH</a>
Copy link
Member

Choose a reason for hiding this comment

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

Avoid using ALL_CAPS directly because screen-readers will read them out as "S - E - A - R - C - H".

This one should be, e.g., "Google search".

<section>
<a href="http://www.google.com" md-button color="primary">SEARCH</a>
<a href="http://www.google.com" md-raised-button>SEARCH</a>
<a href="http://www.google.com" md-fab>
Copy link
Member

Choose a reason for hiding this comment

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

Same thing about aria-label here

@tinayuangao tinayuangao force-pushed the a18n-site branch 2 times, most recently from bf6e99d to 7367ac0 Compare July 18, 2017 18:35
@tinayuangao
Copy link
Contributor Author

Comments addressed. Please take another look. Thanks!


<nav>
<ul>
<li *ngFor="let navItem of navItems">
Copy link
Member

Choose a reason for hiding this comment

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

You don't need the ul / li; the <a> should just be a child of the nav.

moduleId: module.id,
selector: 'accessibility-home',
template: `<p>Welcome to the accessibility demos for Angular Material!</p>
<p>Open the sidenav to select a demo.</p>`,
Copy link
Member

Choose a reason for hiding this comment

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

Template still mentions the sidenav

@@ -0,0 +1,30 @@
<div class="demo-button">
<section>
<h2></h2>
Copy link
Member

Choose a reason for hiding this comment

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

h2 is empty. I'd make the header Button elements

</section>

<section>
<a href="http://www.google.com" md-button color="primary">Google search</a>
Copy link
Member

Choose a reason for hiding this comment

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

Add <h2> here; I'd make the heading Anchor elements

template: '<router-outlet></router-outlet>',
encapsulation: ViewEncapsulation.None,
})
export class EntryApp {}
Copy link
Member

Choose a reason for hiding this comment

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

Add comment for how this is used?

@tinayuangao tinayuangao force-pushed the a18n-site branch 3 times, most recently from c1f68d6 to 364486a Compare July 19, 2017 18:19
@tinayuangao
Copy link
Contributor Author

Comments addressed. Please take another look. Thanks!

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker and removed pr: needs review labels Jul 19, 2017
@andrewseguin
Copy link
Contributor

Please rebase

@tinayuangao
Copy link
Contributor Author

Rebased

@andrewseguin andrewseguin merged commit 8edbe47 into angular:master Jul 27, 2017
@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.

4 participants