Skip to content

[ESLint] Add a rule for EuiToolTip to enforce non-interactive content #9565

Closed

Description

@weronikaolejniczak

Problem

EuiToolTip tooltip content rendered inside a portal with role="tooltip" is not keyboard-reachable. Placing interactive elements (links, buttons, inputs) inside content or title creates an accessibility violation: WCAG 2.1 SC 1.4.13 requires that hoverable content is dismissible and persistent, and interactive tooltip content is explicitly discouraged by the ARIA tooltip pattern.

Despite this, there is no guard preventing consumers from writing:

<EuiToolTip content={<EuiLink href="/docs">Learn more</EuiLink>}>
  <EuiButton>Hover me</EuiButton>
</EuiToolTip>

The correct pattern is to use EuiPopover whenever the content needs to be interactive.

Proposed rule

Add an ESLint rule that warns when interactive elements (a, button, input, select, textarea\, or EUI equivalents like EuiLink, EuiButton, EuiButtonIcon) appear as direct or nested JSX children of the contentortitleprops ofEuiToolTiporEuiIconTip`.

The warning message should direct consumers to use EuiPopover instead.

Auto-fix is not applicable. replacing a tooltip with a popover requires structural changes beyond a simple transform.

Scope

Rule location: packages/eslint-plugin/src/rules/
Target: content and title props of <EuiToolTip /> and <EuiIconTip />
Auto-fixable: no

Activity

  1. changed the title [-][ESLint] Add a rule for EuiButtonIcon to enforce non-interactive content[/-] [+][ESLint] Add a rule for EuiToolTip to enforce non-interactive content[/+] on Apr 28, 2026
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