Skip to content

[EuiFilterSelectItem] Migrate from class to function component #9489

Closed

Description

@weronikaolejniczak

EuiFilterSelectItem renders individual selectable items within EuiFilterGroup. Used in dashboard filter controls.

  • File: components/filter_group/filter_select_item.tsx
  • Class size: 152 lines
  • State: hasFocus
  • Lifecycle: componentDidUpdate

Migration notes:

  • Focus management in componentDidUpdate maps to useEffect.
  • Wrapped with withEuiTheme, can switch to useEuiTheme.

Acceptance criteria:

  • Convert EuiFilterSelectItem to a function component using hooks.
  • Replace withEuiTheme with useEuiTheme.
  • Preserve the existing public API and behavior.
  • Preserve all existing comments verbatim, including the TODO and deprecation comments.
  • Add tests covering:
    • selected item communicates selected state and shows check icon,
    • excluded item communicates unselected state and shows cross icon,
    • neutral item shows empty icon,
    • icons can be hidden,
    • disabled item cannot be selected and doesn’t show a tooltip,
    • focused item receives focused appearance and scrolls into view,
    • tooltip isn’t offered when content is absent or cannot anchor to the item,
    • content truncation can be enabled or disabled.
  • Ensure existing and new tests pass.
  • Avoid unrelated changes or refactoring.

Activity

  1. HuzaifaAbdulRehman commented on Jul 22, 2026

    @HuzaifaAbdulRehman
    Contributor

    Hi @weronikaolejniczak, I’m interested in migrating EuiFilterSelectItem to a function component while preserving its focus, tooltip, ref-forwarding, and scroll behavior. I noticed that the parent issue states community PRs are accepted only for sub-issues labelled help wanted, and this issue currently does not have that label.
    Is #9489 intended to be available for a community contribution? If so, could it please be marked help wanted before I begin?

  2. added
    help wanted
    on Jul 23, 2026
  3. weronikaolejniczak commented on Jul 23, 2026

    @weronikaolejniczak
    ContributorAuthor

    @HuzaifaAbdulRehman we appreciate your motivation 🙏🏻 Looking at the component again, I believe I can mark it as "help wanted" and you can work on it. Thank you!

  4. github-actions commented on Jul 23, 2026

    @github-actions

    👋 Thank you for your suggestion or request! While the EUI team agrees that it's valid, it's unlikely that we will prioritize this issue on our roadmap. We'll leave the issue open if you or anyone else in the community wants to implement it by contributing to EUI. If not, this issue will auto close in one year.

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

    help wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions