WhatSock / apex

Apex 4X: The Comprehensive ARIA Development Suite
MIT License
28 stars 10 forks source link

Recommendation on the tooltip component #31

Closed Gcamara14 closed 2 years ago

Gcamara14 commented 2 years ago

Hi Bryan and team,

Here's a recommendation I had for the tooltip component. I think the first example, "Tooltip with manual click to render" since it functions more like a toggle tip/toggle button should have the aria-role of "aria-pressed."

Environment URL: http://whatsock.com/Templates/Tooltips/Internal/index.htm

HTML BEFORE:

<a data-tooltip="<p>&quot;It is a mistake to think you can solve any major problems just with potatoes.&quot;, Douglas Adams</p>" role="button" id="helpIcon" href="#" class="helpIcon aria-tooltip"><img src="img/ic_help.svg" alt="What is the greatest secret known to man?" title="What is the greatest secret known to man?"></a>

HTML AFTER:

<a data-tooltip="<p>&quot;It is a mistake to think you can solve any major problems just with potatoes.&quot;, Douglas Adams</p>" role="button" aria-pressed="false" id="helpIcon" href="#" class="helpIcon aria-tooltip"><img src="img/ic_help.svg" alt="What is the greatest secret known to man?" title="What is the greatest secret known to man?"></a>

Recommendation:

Add the aria-pressed attribute to the first example. Let me know you're thoughts on this!


Thanks, GIo

accdc commented 2 years ago

Hi, that's a great idea, and I've already added it. :)

In doing so, I stumbled across a bug in Chrome where the pressed state of dynamically added aria-pressed will not be correctly reflected in the accessibility tree. So, if you view the referenced test page in Firefox it will work correctly, but if you do so in Chrome it will not.

I have already filed a bug against this in Chrome with Google, so hopefully this won't take long to correct. https://bugs.chromium.org/p/chromium/issues/detail?id=1289288

The 4X Tooltip Module is working correctly though, so I'll close this issue as fixed for now, but I'll keep tabs on the Chrome bug and update this thread when this is hopefully fixed in the near future.

@aleventhal

accdc commented 2 years ago

Thanks to @aleventhal and others for working on this. The pressed state issue is now fixed in the latest release of Chrome Beta.