design-system-react icon indicating copy to clipboard operation
design-system-react copied to clipboard

Accessibility: Disabled Button with a tooltip renders <a> with empty text

Open minevskiy opened this issue 10 years ago • 8 comments

Repro:

  1. go to demo > PopoverTooltip
  2. Edit the "Tooltip on Button Group": add disabled="true" to the Edit button.
  3. Inspect button's HTML
  4. Observe <a> tag with no text. This is an accessibility issue: [A11Y_DOM_04] Links must have non-empty text content. More info http://sfdc.co/a11y_dom_04
screenshot at mar 22 11-40-56
<button class="slds-button slds-button--neutral drop-target drop-element-attached-top drop-element-attached-right drop-target-attached-bottom drop-target-attached-right" disabled="" data-reactid=".l.0.1">   
   <span data-reactid=".l.0.1.3">Edit</span>
   <a href="javascript:void(0)" style="background-color:transparent;width:100%;height:100%;position:absolute;left:0px;top:0px;" data-reactid=".l.0.1.$MouseEventTarget"></a>
</button>

minevskiy avatar Mar 22 '16 18:03 minevskiy

@donnieberg could you look into it?

ivanbogdanov avatar Mar 23 '16 16:03 ivanbogdanov

@minevskiy let me know if https://github.com/salesforce-ux/design-system-react/commit/0f21bcea0cb04dc660d27b5e2f91808ebee66ed0 fixes it

ivanbogdanov avatar Mar 23 '16 21:03 ivanbogdanov

I'm merging it into react013 branch in two min :)

donnieberg avatar Mar 23 '16 21:03 donnieberg

@madpotato, @donnieberg , I've tested the fix and it works (even without the "tooltip trigger" suffix in assistiveText's span).

minevskiy avatar Mar 23 '16 21:03 minevskiy

awesome! I don't think we need assistiveText there because: ariaHidden={true} is on the component

ivanbogdanov avatar Mar 23 '16 21:03 ivanbogdanov

ariaHidden: true was there before, but Accessibility tests still failed. ~~I'll email Jesse about why ariaHidden is not sufficient.~~

minevskiy avatar Mar 23 '16 21:03 minevskiy

Interesting, the ariaHidden attribute is not rendered. Is this the right attribute name? I suspect it should be 'aria-hidden': true. OK, I've confirmed that it should be 'aria-hidden': true, but I still get the Accessibility error, so I'll email Jesse.

minevskiy avatar Mar 23 '16 21:03 minevskiy

Fixed

minevskiy avatar Mar 24 '16 01:03 minevskiy