Skip to content

[EuiToolTip] Tooltips on buttons persist after clicking #9520

Closed

Description

@Zacqary
hover.mov

Hovering over a button and then moving the mouse away makes the tooltip disappear. Clicking the button persists the tooltip until the user clicks something else.

This is because tooltips persist on elements that are in focus.

Tooltip persistence on focus is a desirable behavior for keyboard navigation, but it's often undesirable for mouse users. The user already knows what they just clicked, so after clicking the button, the tooltip should go away again on mouseout.

A possible way of implementing this is to persist tooltips if an element is :focus-visible and not just :focus.

Activity

  1. added
    ⚠️ needs validation
    on Mar 20, 2026
  2. added theissue type on Mar 20, 2026
  3. weronikaolejniczak commented on Mar 31, 2026

    @weronikaolejniczak
    Contributor

    Hey @Zacqary 👋🏻 Thanks for raising this! We have a component sweep initiative for tooltips planned and we'll tackle it as part of that!

  4. weronikaolejniczak commented on Apr 1, 2026

    @weronikaolejniczak
    Contributor

    @Zacqary If we do not persist the tooltip on button click then tooltips won't be discoverable at all on mobile devices. :focus-visible alone doesn't address this.

    @elastic/accessibilitycontractors this behavior has been developed on purpose. There is an argument to be made here that it's better for accessibility that the tooltip persists when clicked (if it's simply hovered, on hover out it closes). Not only for keyboard navigation but also for mouse users (that e.g. have jitters) or for other forms of input (eye-tracking). Could you share any guidance here?

  5. ghudgins commented on Apr 3, 2026

    @ghudgins

    Is there a way we can not trigger tooltips when the application returns focus to an element? Showing tooltips should just happen on hover. Screen readers will read elements on focus regardless... @bhavyarm can you help us here?

  6. bhavyarm commented on Apr 6, 2026

    @bhavyarm
    Contributor

    I think @Zacqary solution of using :focus-visible seems like the best middle ground here.

    I think the accessible fix is to make tooltip persistence modality-aware: persist when triggered by keyboard focus (:focus-visible / keyboard modality), but not when focus came from mouse click. Per APG, tooltips opened from hover should dismiss on mouseout, and tooltips opened from focus should dismiss on blur. That preserves keyboard access without leaving mouse-triggered tooltips stuck open.

    Thanks!

  7. Zacqary commented on Apr 6, 2026

    @Zacqary
    ContributorAuthor

    I understand the concern about mobile devices.

    My objection to that is that on a touchscreen, the user will never see the tooltip until they have already pressed the button. You have to interact with the thing — which you don't know what it does yet! – before you can find out what it does.

    As far as I can find, best UX practices for touchscreen tooltips are to show them on a long-press. This is tricky to implement in Javascript as there's no native HTML touchevent for a touch-and-hold, but it's doable.

  8. weronikaolejniczak commented on Apr 7, 2026

    @weronikaolejniczak
    Contributor

    @ghudgins that is a different issue. Here, we are talking about tooltips showing on clicking the button. You are talking about tooltips showing on focus return. It may partially be solved by this one but focus return is programmatic focus that browsers don't handle consistently. Please refer to: #9549 I already have some ideas but I need to spike them out first.

    My objection to that is that on a touchscreen, the user will never see the tooltip until they have already pressed the button. You have to interact with the thing — which you don't know what it does yet! – before you can find out what it does.

    That's a fair point, probably the use of "discoverable" was poor on my part. I will try :focus-visible and if that works, we're set! (thanks for the suggestion btw)

    I think the accessible fix is to make tooltip persistence modality-aware: persist when triggered by keyboard focus (:focus-visible / keyboard modality), but not when focus came from mouse click. Per APG, tooltips opened from hover should dismiss on mouseout, and tooltips opened from focus should dismiss on blur. That preserves keyboard access without leaving mouse-triggered tooltips stuck open.

    @bhavyarm thank you for looking into this 🫶 That confirms the behavior, although originally intended for increased accessibility, is not required by the specs. cc @mgadewoll

  9. removed
    ⚠️ needs validation
    on Apr 8, 2026
  10. linked a pull request that will close this issue[PoC] Tooltip delay and focus #9581on Apr 9, 2026
  11. changed the title [-][EuiTooltip] Tooltips on buttons persist after clicking[/-] [+][EuiToolTip] Tooltips on buttons persist after clicking[/+] on Apr 9, 2026
  12. weronikaolejniczak commented on May 4, 2026

    @weronikaolejniczak
    Contributor

    @Zacqary The fix will be released this week in Kibana and Cloud UI. Thanks again for the discussion and the fantastic solution hint! 🙏🏻

  13. weronikaolejniczak commented on May 6, 2026

    @weronikaolejniczak
    Contributor

    @Zacqary the issue has been addressed and the fix released on v115.0.0. The change will be added to Kibana by EOW.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions