Comments

Everett Zufelt’s picture

I took a look in the 7.x-2.1 tag of the module.

sharethis.module around line 354. This is the function that generates the markup. I don't think that it will be as simple as switching to links, because of the way that the Javascript behavior is attached, but I only took a quick peak.

But, the essentials are that:

1. The buttons need to receive focus.
2. They need visual focus indicators
3. They need to carry the semantics of buttons / links by:

a. using anchor or button elements.
b. using link or button roles. E.g. <span role="button" ...>

Everett Zufelt’s picture

Version: 7.x-2.1 » 7.x-1.x-dev
Assigned: Unassigned » Everett Zufelt
Category: feature » bug
Priority: Normal » Major
Issue tags: +Accessibility

Going to take a look at this.

Everett Zufelt’s picture

Title: Keyboard and screen reader accessibility » Improve accessibility of sharethis links
Priority: Major » Critical

Modifying title since the admin UI needs work as well. Bumping to critical since using FF 6.x and JAWS 12 (screen-reader) there is no detectable presence of he links on the page.

Generated marup w/ default settings:

<span st_url=http://localhost/sharethis-7/node/1 st_title='Foo' class='st_twitter_large' displaytext="Tweet"></span>
<span st_url=http://localhost/sharethis-7/node/1
st_title='Foo' class='st_facebook_large' displaytext="Facebook"></span>
<span st_url=http://localhost/sharethis-7/node/1 st_title='Foo' class='st_sharethis_large'
displaytext="ShareThis"></span>
Everett Zufelt’s picture

Assigned: Everett Zufelt » Unassigned
Status: Active » Postponed

After doing some looking it appears that the JS for the links comes from an external source. Even adding role=link or changing the spans to anchors would not allow them to be keyboard accessible. It will be necessary to file a bug upstream, if possible.

Everett Zufelt’s picture

Priority: Critical » Major
Everett Zufelt’s picture

I e-mailed ShareThis , their reply:

Right now we don't support accessibility compliance.
I have forwarded this suggestion to our product team.
I will update you on this once I hear from them.

I will update this issue if further information is provided.

Everett Zufelt’s picture

Reply from feedback@sharethis.com to an e-mail I sent:

Right now we don't support accessibility compliance.
I have forwarded this suggestion to our product team.
I will update you on this once I hear from them.

heatherwoz’s picture

Yikes, what a response from ShareThis. I inquired about accessibility via their feedback form as well, but didn't get a reply. What are the most accessible modules for adding sharing links in Drupal 7? Is AddToAny better?

jvalencia’s picture

The fixes might be able to be handled within the drupal module, depending on what is needed

The span tags get filled dynamically with widget code on page load.

If we added something like this:

<span role="button" tabindex="X" class="st_facebook_large"></span>

This would make those span tags that hold the buttons focus-able and role-wary. Would this work?

The only issue I see is that we wouldn't know what tabindex we were on since the buttons are added dynamically to the page. There also might be multiple sets of buttons on a page (like in a blog).

Everett Zufelt’s picture

@jvalencia

role=button allows AT to know that the element is a button, and tabindex allows it to receive focus.

However, neither of these adds the .click handler, which from my * very * preliminary testing was missing i.e. you * have to click with a mouse * and cannot use the keyboard to activate the span. Would be happily corrected on this.

jvalencia’s picture

Again though, would you not be able to add a click handler in the Drupal module?

Something along the lines of attaching a key event that clicks the button?

Unfortunately, I'm not sure the widgets would be screen reader accessible either, but they might be ok.

Everett Zufelt’s picture

Again though, would you not be able to add a click handler in the Drupal module?

* Yes.

Something along the lines of attaching a key event that clicks the button?

* Well, there is no button. But, the big problem, is what function to invoke when the 'button' is clicked. The function that needs to be invoked is stored in the external JS, and I assume is subject to change (?)

jvalencia’s picture

Off the top of my head, you can fire a "click" even from jQuery through javascript.

Then the "button" thinks it has been clicked regardless of what function it calls. The event handler takes care of what function to call.

Everett Zufelt’s picture

Then the "button" thinks it has been clicked regardless of what function it calls. The event handler takes care of what function to call.

* I'd like to see this in actuon, or see documentation. I am not sure how the .click event can magically know which function to invoke.

I think that what you are saying is that you can tell an element to fire it's click event, and it will then invoke all registered click event handlers. This is true, but, I am not sure that there is a '.click()' handler attached to these spans, it might be mouse input only.

Regardless someone needs to either experiment, or dig through the mess of code in the external js to find out.

mgifford’s picture

StatusFileSize
new26.29 KB

I just ran into this. And ya, too bad about the sharethis.com response. Adding a screenshot. Looks like we may need to use something else.

mgifford’s picture

ShareThis_Missy’s picture

Hi there,

Right now, we still don't support accessibility compliance but we're planing to make ShareThis widget accessible in the near future. We will update you as soon as we make a production push. Thanks so much for your patience!!

Thanks,
Missy

heatherwoz’s picture

ShareThis_Missy, it shouldn't take this long to add basic accessibility support - alt text for images, behaviors on elements that keyboard and screen reader users can actually click. I can't believe your developers don't know these fundamentals.

2dareis2do’s picture

And a year later? Any updates?

Patrick Nelson’s picture

No accessibility = don't use the module.

We're removing this from every site we've added it on and replacing it with a better alternative that's designed for today's modern web.

Bad show, ShareThis

mgifford’s picture

Curious what you went with.

heatherwoz’s picture

Yes, I'd love to hear of better alternatives. I've found others that more accessible, but still not fully there.

benjarlett’s picture

Issue summary: View changes

Yes I'd also like to know. I'm not using this because of the (in)accessibility as well

gaxze’s picture

StatusFileSize
new806 bytes

Thought I'd have a look into this and wondered whilst we can't control the html sharethis produce we can change the wrapping span to a button - not sure this will work on ie7 though. This needs testing.

Also added some inline styling to take away the padding, background and border being a button would likely bring in.

This should allow keyboard only accessibility to at least share the content.

Forgot to mention this is using 7.x-2.8 branch.

gaxze’s picture

Status: Postponed » Needs review

Status: Needs review » Needs work

The last submitted patch, 24: sharethis-change-wrapping-span-to-button-1289054.patch, failed testing.

gaxze’s picture

Recreated the patch. hopefully this one passes.

gaxze’s picture

gaxze’s picture

Missed the styling. doh.

gaxze’s picture

Status: Needs work » Needs review
mgifford’s picture

These look like useful changes to the code.

Status: Needs review » Needs work

The last submitted patch, 29: sharethis-change-wrapping-span-to-button-1289054-24.patch, failed testing.

bart.hanssens’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev

GaxZE mentions in #24 that the patch is for 2.8, so changing the version metadata for automated testing

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 29: sharethis-change-wrapping-span-to-button-1289054-24.patch, failed testing.

stefan.r’s picture

Status: Needs work » Needs review
StatusFileSize
new769 bytes

Posting this patch in the correct format so it will pass testing.

One issue seems to be that it allows people to use the keyboard to select the buttons, but pressing enter does nothing.

gaxze’s picture

Cheers. always seem to have issues creating patches in correct format.

stefan.r’s picture

stefan.r’s picture

Revised patch that turns an enter press into a click. This seems to work locally (though on Google+ and "Facebook Like" it requires an extra tab key press - which is just how their widgets work), it would be nice if someone else could test this as well!

dame’s picture

Status: Needs review » Needs work

Hello,

The patch works for configurations that contain the stMainServices class. (e.g. classic buttons). However, "Large chicklets" use the class stLarge instead. Changing the "button" variable code to:

var button = $.merge( $(this).find('.stMainServices'),
                      $(this).find('.stLarge') )[0];

works for both opthions. I am not sure that this is the best solution as there are other configurations that would have to be added to the list classes.

Thanks for the patch!

stefan.r’s picture

StatusFileSize
new1.79 KB
new651 bytes

Made it more generic so that it will work for any class.

stefan.r’s picture

Status: Needs work » Needs review
stefan.r’s picture

StatusFileSize
new1.15 KB
new1.55 KB

Previous patch broke mouse click in firefox as it could not deal with <button> elements.

This patch turns it into a <span role="button" tabindex="0">, and also now triggers also triggers on spacebar key press (as usual in screenreaders) instead of merely on enter key.

dame’s picture

Hi stefan.r,

I can confirm that this patch is working for IE, FF, and Chrome!
Thanks!

dame’s picture

Hi stefan.r,

I can confirm that this patch is working for IE, FF, and Chrome!
Thanks!

stefan.r’s picture

Status: Needs review » Reviewed & tested by the community

On my client side this has also been running on a couple of websites without any issues.

eleuthere’s picture

Does it make the buttons permanent, so that you don't need to fly over the small icon to make a panel of buttons appear ?

chartmann’s picture

Thanks Stefan. #43 worked great. For anyone reading this, don't forget to add visual indication on :focus and :hover to make it compliant!

mgifford’s picture

This still applies nicely. It's been RTBC for 3 months. An reason not to bundle it up into the repo?

epringi’s picture

Decent module and patch 43 worked great, it would be cool if it were included. :)

bvoynick’s picture

Thanks Stefan, works well.

Would be great to include in the module.

joseph.olstad’s picture

StatusFileSize
new1.5 KB
new431 bytes

Thanks again Stefan.r, great work! I had to remove the inline style on the span element, so minor change, see interdiff_43_to_53.txt

RTBC +1

stefan.r’s picture

why are we removing it?

joseph.olstad’s picture

I had to remove the inline style on a site with lots of css because I think we had specified a background and when I installed the patch after upgrading to the latest version of sharethis the icons disappeared.

However the upgrade was necessary for us because it fixed a javascript exception that we observed only on apple iOS 9.0.2 ipads

For whatever reason upgrading to the latest sharethis and using your patch improved compatibility with apple iOS 9.0.2 ipads.

However when I first installed, the items were in the DOM as expected but some of the sharethis icons were invisible. it wasn't until I removed the inline styling as seen in comment#43 interdiff_43_to_53.txt that the sharethis icons became visible (after cache clear).

Thanks, this solved our issues with iPad 9.0.2. All other browsers we tested on work fine too.

stefan.r’s picture

Status: Reviewed & tested by the community » Needs review

I'm just wondering if we're not breaking anything by removing the inline styles, they may have been there for a reason...

ShareThis Support’s picture

Hi There,

Thanks for your patience here! We've made some changes in our support organization and we're working through responding to these. We know this is still an outstanding request, so we've escalated back up to our engineering team. We'll be sure to keep you posted on this!

Best
ShareThis Support

vinmassaro’s picture

We did some accessibility audits on our sites and are close to dropping the use of Sharethis. I then came across this thread. What needs to be done to get this moving again? I can test the patch but it sounds like there needs to be some coordination with @ShareThis Support.

vinmassaro’s picture

Patch in #53 still applies correctly but I agree with @stefan.r about removing the inline styles coming from Sharethis - they are probably there for a reason.

@ShareThis Support: it would be great to get an update on if there are any plans to change this on your end.

stefan.r’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new1.55 KB

Re-uploading #43 and re-setting to RTBC

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 60: sharethis-link_accessibility-1289054-43.patch, failed testing.

yogeshmpawar’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new2.15 KB

Previous patch was failed to load, so i have make some changes in this patch.

Status: Needs review » Needs work

The last submitted patch, 62: sharethis-link_accessibility-1289054-62.patch, failed testing.

navneet0693’s picture

Status: Needs work » Needs review
mgifford’s picture

@Yogesh Pawar - any chance you can provide an interdiff to see what was changed. The patch before was RTBC so it should be pretty similar.

navneet0693’s picture

Hi @mgifford, Patch was failing to apply because of code changes in latest branch, he just re-rolled it accordingly with latest version.

mgifford’s picture

Ok, thanks for the clarification @navneet0693

Do we need button.keypress(); as well as button.click();

EDIT: Also noticed this error
Notice: Undefined index: attributes in theme_sharethis() (line 322 of /home/drfxq/www/sites/default/modules/sharethis/sharethis.module). - See more at: https://drfxq.ply.st/node/1#sthash.FbXRjAPI.dpuf

Status: Needs review » Needs work

The last submitted patch, 62: sharethis-link_accessibility-1289054-62.patch, failed testing.

yogeshmpawar’s picture

@mgifford - this problem is solved in node - https://www.drupal.org/node/2547601. if we applied this patch then this error is removed.
yes we can use button.keypress() function also.

naveenvalecha’s picture

Issue tags: +Needs reroll

I have disabled the ci testing for 7.x-2.x branch b/c there are not any tests in the repo that's why ci was throwing error on every patch.

We have disabled the automated testing until we have tests

stefan.r’s picture

EDIT: Also noticed this error
Notice: Undefined index: attributes in theme_sharethis() (line 322 of /home/drfxq/www/sites/default/modules/sharethis/sharethis.module). - See more at: https://drfxq.ply.st/node/1#sthash.FbXRjAPI.dpuf

This doesn't seem to be caused by this patch, or is it?

stefan.r’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new1.59 KB
will kirchheimer’s picture

-- removing comment, bad patch application on my part --

yogeshmpawar’s picture

Any Update on this issue ?

johncionci’s picture

Created a patch based on https://www.drupal.org/node/1289054#comment-10513614 but have added some other markup to display
the title attribute for the span tags and well as output the actual text of the sharing element for better screenreader descriptions.

johncionci’s picture

StatusFileSize
new2.31 KB

Updating bad patch from previous comment.

moghingold’s picture

I updated this patch to work with version 7.x-2.13 of the module. Note: this does not address the lack of keyboard focus on links and buttons in any externally loaded iframes, such as the email service modal.

vladimiraus’s picture

Status: Needs review » Closed (outdated)

Drupal 7 is no loner supported.
Marking as outdated.