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

amp-carousel: optional aria-label for navigation buttons #9431

Merged
merged 9 commits into from May 22, 2017

Conversation

alannawalton
Copy link
Contributor

@alannawalton alannawalton commented May 19, 2017

With these new attributes 'data-next-button-aria-label' and 'data-previous-button-aria-label' the aria-label can be set for each of these elements.

Closes #442

aria-labels on the 'back' and 'next' buttons of the carousel can now be changed instead of defaulting to 'next/previous item in carousel'
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@alannawalton
Copy link
Contributor Author

I signed it!

Following the JS Style Guide
(forreal this time, they are really gone)
Copy link
Contributor

@aghassemi aghassemi left a comment

Choose a reason for hiding this comment

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

Looks pretty good Alanna. A few requests:

  • Couple of nit comments in the code
  • Let's also rename the title of the PR to include the component it is changing,
    e.g amp-carousel: optiona aria-label for navigation buttons
  • Let's document these new attributes in the .md file of the component.

@@ -98,7 +98,7 @@

</amp-carousel>

<amp-carousel width=auto height=300 controls>
<amp-carousel width=auto height=300 data-next-button-aria-label="Go Forward" data-previous-button-aria-label="Go Back" controls>
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Let's use more descriptive values here to set a good best practice precedence. Maybe

Go to next slide and Go to previous slide

@@ -71,7 +71,13 @@ export class BaseCarousel extends AMP.BaseElement {
this.prevButton_.setAttribute('role', 'button');
// TODO(erwinm): Does label need i18n support in the future? or provide
// a way to be overridden.
this.prevButton_.setAttribute('aria-label', 'Previous item in carousel');
if (this.element.hasAttribute('data-previous-button-aria-label')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

remove the // TODO above since it is done

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

@alannawalton alannawalton changed the title Optional aria-label amp-carousel: optional aria-label for navigation buttons May 19, 2017
Updated aria-labels to be more descriptive. Removed unnecessary TODOs. Altered title of pull request. Updated .md to describe feature
Copy link
Contributor Author

@alannawalton alannawalton left a comment

Choose a reason for hiding this comment

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

done

@aghassemi
Copy link
Contributor

@alannawalton Looks great. I think you need to add your @google.com address to GitHub (see https://help.github.com/articles/adding-an-email-address-to-your-github-account/) to make the CLA check pass.

@alannawalton
Copy link
Contributor Author

I signed it

@googlebot
Copy link

CLAs look good, thanks!

@aghassemi aghassemi merged commit 7689281 into ampproject:master May 22, 2017
@aghassemi
Copy link
Contributor

Merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants