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

Add keyboard support to amp-social-share #9215

Merged
merged 3 commits into from
May 10, 2017

Conversation

kmh287
Copy link
Contributor

@kmh287 kmh287 commented May 8, 2017

Adds keyboard support to amp-social-share.

  • Pressing enter or space when an amp-social-share is focused will activate the element as a click would
  • The role of amp-social-share has been changed from "link" to "button"

Partial for #8810

/to @aghassemi

@@ -96,13 +97,35 @@ class AmpSocialShare extends AMP.BaseElement {
? '_top' : '_blank';
});

this.element.setAttribute('role', 'link');
this.element.setAttribute('role', 'button');
Copy link
Contributor

Choose a reason for hiding this comment

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

let's set tabindex to 0 if it is not provided by author already.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good idea, done

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.

Lgtm

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

4 participants