Skip to content
easeweb
Search topics

Tooltips that vanish on approach and can't be dismissed

The pop-up text shows only while the pointer is on its button, sits a gap away from it, covers the field below, and ignores Escape.

WCAG 2.2
SC 1.4.13AA· new in 2.1
Required by
EN 301 549 (EU)
Broken
The accessibility problem illustrated: Low vision:How do I close this?
01

The problem

People who zoom, magnify or move the pointer slowly can't reach the pop-up text to read it, and can't hide it when it covers what they need

02

Try it

Point at the ? beside Delivery fee, then move down onto the pop-up text

Can you read all of the pop-up text? Press Tab to reach the button, then Escape: can you see the coupon field again?

Broken Can you fix this?

BrokenPop-up text shown by the button's own hover

Delivery fee Free on orders over $50. Otherwise $6 to most addresses. $6

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

Keep the tooltip open while needed, and let Escape hide it

Before
BrokenPop-up text shown by the button's own hover
<p class="fee">  Delivery fee  <button type="button" class="tip-trigger" aria-describedby="fee-tip" aria-label="Delivery fee details">?</button>  <span role="tooltip" id="fee-tip" class="tip-note">Free on orders over $50. Otherwise $6 to most addresses.</span></p><label for="coupon">Coupon code</label><input id="coupon">
What is wrong3 points

The markup is already a correct tooltip, with role="tooltip" and aria-describedby. The role tells a screen reader what the pop-up text is, but it adds no behaviour, so the failure stays.

  • The pop-up text disappears as the pointer moves toward it. It belongs to the button's hover alone, so crossing the 8-pixel gap closes it.
  • The pop-up text can't be dismissed where it is: nothing listens for Escape.
  • The coupon field can't be seen: the pop-up text covers it until focus moves on.
After

A hover tooltip that stays and hides on Escape

<p class="fee">  Delivery fee  <span class="tip">    <button type="button" aria-label="Delivery fee details" aria-describedby="fee-tip">?</button>    <span role="tooltip" id="fee-tip" class="tip-note" hidden>Free on orders over $50. Otherwise $6 to most addresses.</span>  </span></p>
How it is fixed5 steps
  1. Put the button and the pop-up text in one .tip, so hovering either one counts.
  2. Give the pop-up text an invisible ::before bridge over the gap, so the pointer stays on the component all the way from the button to the pop-up text.
  3. Show the pop-up text while .tip has hover or focus, and close it only when both have left, with no timer.
  4. On Escape, hide it without moving anything. It stays hidden until the user leaves and comes back.
  5. Keep aria-describedby, so a screen reader reads the pop-up text with the button even while it is hidden.

This fixes the Before and passes 1.4.13.

04

Design ideas

Pop-up text can stay until people are done with it

Four ways to show the same fee rule. Press Details, point at each ? and move onto its pop-up text, wait there, and Tab to it and press Escape: two let everyone read the rule and clear it, one fades before a slow reader is done, and one can’t be cleared off the coupon field.

In the design file

  • Draw the pop-up touching its ? button. If there is a gap, such as 8 pixels, mark it as part of the pop-up, so the pointer can cross it without the pop-up closing.
  • Draw the ? button with its focus ring and the pop-up open.
  • Say whether each pop-up opens on hover or on click. Hover suits a short label; click suits a rule people need to read.
  • Draw how the pop-up opens with a tap, since phones have no hover.

Passes

  • Subtotal$38

    Delivery fee Free on orders over $50. Otherwise $6 to most addresses. $6

    A Details pill that opens a card An icon and a word in a pill read as something to press, not something to point at. Nothing appears on hover or focus; a click, a tap, Enter or Space opens a light card that stays until Escape or a click outside, the same on touch, at the cost of a press before anything shows.

    Rule of thumb: Use native HTML first

  • Subtotal$38

    Delivery fee $6

    Free on orders over $50. Otherwise $6 to most addresses.

    The rule written under the fee Nothing appears on hover or focus, so 1.4.13 has nothing to ask. The rule sits in a soft grey strip with a truck icon, #475569 on #f1f5f9 at 6.92:1, readable at any zoom; it costs two lines of height and suits a rule people need before they pay.

Fails

  • Subtotal$38

    Delivery fee Free on orders over $50. Otherwise $6 to most addresses. $6

    A light hint that fades after three secondsWCAG 1.4.13 A pale blue bubble under the ?, #1e3a8a on #eff6ff at 9.52:1, easy to move onto and cleared by Escape, but it fades three seconds after it opens while the pointer or focus is still there. Pop-up text may leave only when people move away or dismiss it, and a slow reader is still on the first sentence.
  • Subtotal$38

    Delivery fee $6

    A hover card that Escape can’t closeWCAG 1.4.13 A roomy white card with a heading, opened by hover or focus and easy to move onto, with no timer. It lies over the coupon field, though, and Escape does nothing, so the only way to see the field is to move the pointer or focus away from the ?.
05

Verify the fix

5 checks.

Test with: Mouse, Keyboard, Zoom, Screen reader

0 of 5 checked

Record the OS, browser and assistive-technology versions, the build, the date, and the actual result of each step. Repeat after the shared tooltip component changes.

How screen readers handle role="status" and aria-describedby

Limits

This covers a short piece of pop-up text tied to one button. It doesn't cover menus, dialogs or pop-ups with links inside them, or content that appears on scroll or after a delay. A chart's tooltip that only a pointer can open, when it is the only place a value is shown, is covered in chart tooltips a keyboard can't open, and help beside a form field that only a hover shows in form field help only on a help page or on hover. Test your real tooltips at the zoom levels and with the assistive technology your users have.

This is a recreated teaching example, not a finding about a named client. The code is a starting pattern: test it in your own product. No completed assistive-technology test is claimed here.

EaseWeb service

Fixed it? Keep it from coming back.

I turn guides like this one into rules your coding agents follow and checks your CI runs. Then I retest by hand with a keyboard and screen readers, periodically.

See the service