Skip to content
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.

Broken
Covers the field. Escape does nothing.
The accessibility problem illustrated.
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?

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 pop-up text open while the pointer or focus is on the trigger or the pop-up text, and let Escape hide it.

  1. 1The pointer can move onto the pop-up text without it closing.
  2. 2Escape hides the pop-up text without moving focus or the pointer.
  3. 3The pop-up text stays until the user dismisses it or leaves, never on a timer.
Before Pop-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">
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>

04

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.

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. 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.

Keep this fixed as your code changes.

Turn guides like this into rules your coding agents and CI follow, then have the result retested with a keyboard and screen readers.

How retests work