I'm building an accessible tooltip — my first dive into the world of accessibility. It is shown next to an input and right now I'm thinking about how to show them to users with disabilities. The design does not allow to show it on focus so I was thinking, do screen reader users touch/have mouse at all? My idea is to hook for the first mousemove
event and switch mode of tooltips to show on hover, and if no mousemove ever happened — it would show on focus. But I have nobody who could tell me about his disability experience so I was hoping if people here have knowledge on screen reader users patterns.
2 Answers
I'm a little confused by your original question. At first you say
The design does not allow to show it on focus
and then you say
if no mousemove ever happened — it would show on focus.
So are you planning on showing the tooltip with keyboard focus or not?
There's a tooltip pattern in the "WAI-ARIA Authoring Practices 1.1", although it's still a work in progress. A tooltip must appear on either a mouse hover or keyboard focus.
There are many types of screen reader users. Some users have low vision and augment their limited sight by using a screen reader. Those types of users might use a mouse. Some users have cognitive or learning issues and augment their experience with a screen reader to help them read and understand a page. Those users probably use a mouse too. Some users have very limited or no sight and use a screen reader as their only means of interacting with a webpage. Those users will not use a mouse. This is just a small sample of various types of users.
-
I meant if user has no sight then visual design team (that forbid showing tooltips on focus) wouldn't apply to them so I thought it would be fine to show in that case. Thanks for your advice, I went with showing invisible tooltip on focus and leaving visible one on hover — that way reader reads it and visual requirement is fulfilled also. Dec 26, 2018 at 9:27
As Slugolicious says, some people do use a mouse together with a screen reader.
The design does not allow to show it on focus
I don't know what your website or application does, but this sounds highly unusual! If a tooltip is okay on hover, why isn't it okay on focus? I'd send that back to the visual design team as a bug, or insist that they justify this.
I went with showing invisible tooltip on focus and leaving visible one on hover
You should show a visible tooltip on focus - because some sighted users aren't using a mouse or a screen reader. Many users with dexterity impairments can't use a mouse confidently, so the keyboard is their preferred input method. Accessibility isn't just about users with visual impairments.
My idea is to hook for the first mousemove event and switch mode of tooltips to show on hover, and if no mousemove ever happened — it would show on focus.
I don't recommend this, because it segregates users - classing them as either a keyboard user OR a mouse user. In reality, many users are both:
- Dexterity impairments vary in degree, just like visual impairments. A user may be capable of using a mouse or touchpad for some operations (like switching windows, or scrolling), but have difficulty with adjacent small targets (like radio buttons, or a list of links). So they might arrive at your application via a mouse, but then prefer to switch to the keyboard for the input you describe. By this time, your javascript has disabled the tooltips appearing on focus.
- Users (without any dexterity or visual impairments) may use a mouse, but prefer to navigate between form inputs by keyboard. This is just normal data-entry behaviour, which anybody might use.
- For users who only use a keyboard, be aware that there may still be a mouse attached to their computer, and it can get moved by accident. For example: Alice has a hand tremor, and never uses the mouse. Their colleague Bob brings the morning mail, and knocks the mouse when they put the envelopes down on the desk. Now the tooltips stop working :-(
-
In our design hint is not a separate focusable item, but an icon within the input. Showing it when you focus input will obscure part of the form when you might just want to enter value in the field and do not care about the tooltip (already saw it before or just know what you are doing). Might not be ideal and I will bring this to the design table, but I don't really have a word there. Dec 27, 2018 at 15:36
-
I think I understand what you mean by an "icon with the input". But in your question you said it was next to the input. A drawing would help here. Do you mean there is a text input, and a help icon, with one border around both of them? If so, I would implement the tooltip as a button, which shows the tooltip when the button is clicked. That way mouse, touchscreen, speech control, and keyboard users can all activate it. You can still add a mouseover handler to make it appear on hover. May 28, 2019 at 13:44