Skip to content

[Meta][EuiTooltip] Flexibility, accessibility & guidelines #4040

Closed as not planned

Description

@cchaos

Flexibility

Currently, adding EuiTooltip can be a bit of a pain because you have to wrap your component with the EuiTooltip component, which creates a wrapping DOM element, which may not display as you need so you have to pass an anchorClassName to override the display...

A couple of ways we can make adding tooltips easier and more flexible:

Accessibility

Following watching this presentation on the accessibility and overall useful "tips" for tooltips. My takeaways for EuiTooltip (understanding that tooltips in EUI are here to stay 😉 ):

✅ On focus
✅ No dismiss on timeout
❌ Touch/eye control devices
❌ Dismiss without moving “cursor”
❌ Tooltip content is hoverable

  • Could create a toggle-able version (clickable anchor though couldn’t have any other function).
  • And/or just simply supply a close button close to the triggering element. We’d have to implement the triangle path to the tooltip. Add a floating close button to all "popovers" #3024
  • Even though she said ESC may not be ideal, it may be a good solution in addition to a close button

Guidelines (added to docs in #5066)

Some additional bits we should add to doc guidelines for usage:

  • Keep it short
  • Keep in mind the purpose: naming or describing
  • Keep it non-essential

Activity

  1. myasonik commented on Sep 16, 2020

    @myasonik
    Contributor

    Related #3024


    I'm broadly +1 on all the ideas. Each of those would improve our tooltips.

    To add one more thing we could do, maybe just as usage guidelines in the docs right now, is to remind consumers that any and all content that's in the tooltip looses all structure so anything other than a naked string is probably better suited for something else (e.g., headings are lost, actions are practically unreachable).

  2. cchaos commented on Sep 16, 2020

    @cchaos
    ContributorAuthor

    Here's a start on some good do's and don'ts:

    Don't: Put interactable content in a tooltip
    Do: Use a popover

    Don't: Hide important validation information behind a tooltip
    Do: Use inline help text

    Don't: Put formatted text in the tooltip
    Do: Unless it can have the same meaning if read as plain text

  3. changed the title [-][EuiTooltip] Accessibility[/-] [+][EuiTooltip] Accessibility & guidelines[/+] on Sep 16, 2020
  4. changed the title [-][EuiTooltip] Accessibility & guidelines[/-] [+]META: [EuiTooltip] Flexibility, accessibility & guidelines[/+] on Sep 18, 2020
  5. added
    meta
    on Sep 18, 2020
  6. cchaos commented on Sep 18, 2020

    @cchaos
    ContributorAuthor

    As a side note, some of the more a11y focused efforts here could also be pushed onto EuiPopover as well.

  7. changed the title [-]META: [EuiTooltip] Flexibility, accessibility & guidelines[/-] [+][EuiTooltip] Flexibility, accessibility & guidelines[/+] on Sep 20, 2020
  8. changed the title [-][EuiTooltip] Flexibility, accessibility & guidelines[/-] [+][Meta][EuiTooltip] Flexibility, accessibility & guidelines[/+] on Jan 23, 2023
  9. cee-chen commented on Apr 17, 2023

    @cee-chen
    Contributor

    Closing this as not planned due to the age of the issue and lack of owner.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    accessibilitymeta

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions