-
Notifications
You must be signed in to change notification settings - Fork 345
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
Possible conflict between role tooltip and WCAG 2.1 Success Criterion 1.4.13 Content on Hover or Focus #811
Comments
The Working Group just discussed The full IRC log of that discussion<jamesn> TOPIC: tooltips<jamesn> https://github.com/w3c/aria-practices/wiki/August-6%2C-2018-Meeting#wcag-requirements-for-tooltip <jamesn> https://github.com//issues/811 <jamesn> mk: ambiguity in the pattern is that the pointer needs to be able to be moved over the additional content without it disappearing <jamesn> ... it would have been obvious to me that this should happen <jamesn> hh: it is not always when there is interactive stuff in the tooltip <jamesn> jn: reason is for zoom users <jamesn> mk: do we need to make a simple edit to what is in the pattern <jamesn> mk: Do we need to specify about the hover <jamesn> hh: need to specify that need to add something to "If the tooltip is invoked with mouseIn, then it is dismissed with on mouseOut." about mouseOut unless focus moved over the tooltip <jamesn> hh: we have made a statement about mouse behavior but WCAG states something different <jamesn> mk: the 2nd part was for tooltips which include interactive elements... there is no reason for keyboard users to focus that tooltip... there is no reason to make it focusable. <jamesn> Github: https://github.com//issues/811 <jamesn> siri: depends how much content there is in the tooltip... to allow the screen reader to read line by line in virtual mode we need to allow focus to move to the tooltip content. <jamesn> mk: in that case want the dialog pattern <jamesn> siri: dialog pattern some screen readers will be in application mode <jamesn> mk: if want focus to move to it use dialog pattern - if don't use tooltip pattern <jamesn> mk: Provide a mechanism to easily dismiss additional content <jamesn> mk: the such as seems to describe a dialog not a tooltip <jamesn> Evan: does the triggering element have anything to indicate it is a tooltip <jamesn> ... maybe a next button <jamesn> hh: what does role tooltip actually do other than exposing a tooltip role to the AAPI <jamesn> mk: tooltip role doesn't seem that useful to me... can aria-described pointing to any other element... what would anything do to this <jongund> have to go <jamesn> hh: I would expect virtual focus to be able to go to it <jamesn> siri: if keeping non modal dialog then tooltip means that whenever hover it content should appear just on focus <jamesn> mk: can't think of a reason why non modal dialog wouldn't work <jamesn> hh: need a shortcut to move focus to it <jamesn> mk: one of these patterns where we don't have everything we need <jamesn> mk: not sure what to do about that yet |
I humbly and hopefully suggest Related:
|
Carmacleod, Since tooltips don't receive focus would your proposal be only for tooltip dialogs or are you proposing to make tooltips focusable? |
Good question, and I don't have a good answer. :) When I saw the meeting-bot comment containing tooltip discussion notes from the ARIA Working Group with "hh: need a shortcut to move focus to it", I simply wanted to make sure that if a shortcut is added to move focus to a tooltip (or tooltip dialog), then Tooltips (either title attribute or custom) have been a multi-pronged accessibility problem for so long that maybe it's time for some off-the-wall changes to their UI (such as perhaps allowing them to take focus under certain conditions). ;) Anyhow, I did not mean to go off-topic for this issue, which is about WCAG SC 1.4.13. |
The ARIA Authoring Practices (APG) Task Force just discussed The full IRC log of that discussion<MarkMccarthy> TOPIC: Tooltip conflict<MarkMccarthy> mck: in summary - this is about specific language <MarkMccarthy> mck: i think the issue is that our language doesn't say anything about mouse hovered on a tooltip; that we don't generally provide mouse guidance in APG patterns <MarkMccarthy> mck: is this an actual conflict? should we change the wording? or say it's not an issue? <MarkMccarthy> carmacleod: tooltip is REALLY complicated. mouse is integral to using tooltips, mostly, but depends. it's not something I've been easily able to resolve <MarkMccarthy> Sarah_Higley: I'd be in favor of adding wording about mouse behavior for tooltips, becasue it's easy to get that wrong <MarkMccarthy> mck: across most of WCAG we don't usually have mouse reqs, but for this specific instance, there's issues around pointers etc. <MarkMccarthy> mck: that's an exception to the norm right? <MarkMccarthy> carmacleod: yeah <Jemma> git --help <MarkMccarthy> github: <MarkMccarthy> github: https://github.com//issues/811 <MarkMccarthy> mck: so what i'm hearing is we want to describe accessibility related pointer requirements in the APG pattern <MarkMccarthy> carmacleod: i think so <MarkMccarthy> Sarah_Higley: yes, definitely <MarkMccarthy> Sarah_Higley: the difficulty is how to describe it, certain interactions, etc. but that can be part of another discussion <MarkMccarthy> mck: i'd really welcome someone to draft some changes to the pattern in a PR, if someone can <MarkMccarthy> Sarah_Higley: I can, i've been writing about tooltips lately. i think there's some stuff about dismissal that is controversial that'd be worth discussing before a PR <MarkMccarthy> mck: a draft PR can contain anything, even if it'll go down in flames [laughs] <MarkMccarthy> Sarah_Higley: okay <MarkMccarthy> carmacleod: or add stuff to the issue before ready for the PR <MarkMccarthy> group: thanks Sarah_Higley <MarkMccarthy> Sarah_Higley: I planned on opening an issue anyway, so let's just go all in! |
Based on a mix of discussion and opinion, here are the additions to the APG tooltip pattern I would suggest based on this issue. For more potentially controversial or opinion-based recommendations, I have added the prefix "(opinion)".
That last one is probably the most touchy, so I'll expand on the reasons for it: Escape is not always a feasible way of dismissing a tooltip when focus is not on the triggering element. If the tooltip exists within a dialog, or focus happens to be on an element like a combobox or menu button, pressing escape will be handled by the dialog/menu button/combobox. Escape will not only not dismiss the tooltip, but will also cause undesired side effects (e.g. you try to dismiss a tooltip but end up closing the entire dialog). In addition to the practical limitations, it seems more user-friendly to provide a pointer-based method of dismissing tooltips. Since a close button would be solely for the benefit of pointer users, the simplest approach would likely be to remove it from the tab order and not treat it as interactive tooltip content that would need a separate keyboard shortcut. If it makes more sense to move forward with the first, or first and second recommendations and table the third as out of scope, I'm definitely open to that too :). |
I have no problem with a close button for pointer users. But
Also the SVG graphic of your delete button needs a focusable=false, otherwise it gets the focus invisibly in IE 11 - which also leads to a wrong output in the screenreader because the SVG has aria-hidden |
In Edge, closing the tooltips with ESC does not work and in Firefox ESR, the tooltip is immediately hidden again at the Delete button on mouseover. And your tooltips don't look nice in High Contrast Mode: missing border and triangle becomes block. The "x" to close the tooltip is a little near to its border Firefox ESR displays 2 focus frames. The browser's focus frame is much larger than the element itself. |
@JAWS-test thanks for your comments, I'll do my best to address them in order:
|
I understand your argument. However, it only applies if the application has been implemented correctly. I've already seen enough examples where the ESC key closed the entire pop-up, although the focus was on an element inside the pop-up that is closed with ESC.
I agree with you. I had only seen the opposite behavior in your example: re-display for mouse users, but not for keyboard users. But the exciting question is how to do this semi-permanently, not permanently. Unfortunately I have no idea.
I'm sorry. I knew your page and thought that your example should serve as a template for APG because it deals with exactly the same questions. That's why I had a closer look. |
The close button should not be inside the tooltip. It can be marked with aria-hidden=true, but the attribute will be ignored if it is referenced by aria-labelledby or aria-describedby. In JAWS, for example, the close button in the tooltip is output with Firefox and IE 11, but not with Chrome. See: FreedomScientific/standards-support#251 |
The APG generally does not exclude or recommend against techniques solely because they have the potential to be misused. However, if you think that escape should never be the mechanism for dismissing tooltips, it might be better to raise that issue against WCAG, since escape is explicitly mentioned.
Unless the close button itself is directly referenced by Hope that helps! |
Would you be opposed to rewording this as I've seen at least one implementation that lets the user mouse over the tooltip but not back to the trigger without dismissing the tooltip. |
Issue 1:
ARIA:
https://www.w3.org/TR/wai-aria-practices-1.1/#tooltip
If the tooltip is invoked when the trigger element receives focus, then it is dismissed when it no longer has focus (onBlur). If the tooltip is invoked with mouseIn, then it is dismissed with on mouseOut.
WCAG 2.1
https://www.w3.org/TR/WCAG21/#content-on-hover-or-focus
If pointer hover can trigger the additional content, then the pointer can be moved over the additional content without the additional content disappearing.
The additional content remains visible until the hover or focus trigger is removed, the user dismisses it, or its information is no longer valid.
In the ARIA spec it is the triggering element (link/button) only that controls the show/hide of the tooltip content (additional content). This conflicts with the WCAG spec where focus needs to encompass the trigger and additional content.
Issue 2:
https://www.w3.org/WAI/WCAG21/Understanding/content-on-hover-or-focus.html
As I understand it role=tooltip does not allow active embedded elements, however, the WCAG 2.1 spec stats:
Provide a mechanism to easily dismiss the additional content, such as by pressing Escape or selecting a close button.
The text was updated successfully, but these errors were encountered: