Skip to content

[EuiSelectable] Add global mock recommendation to docs#9330

Merged
weronikaolejniczak merged 2 commits intoelastic:mainfrom
weronikaolejniczak:fix/selectable-virtualized
Jan 22, 2026
Merged

[EuiSelectable] Add global mock recommendation to docs#9330
weronikaolejniczak merged 2 commits intoelastic:mainfrom
weronikaolejniczak:fix/selectable-virtualized

Conversation

@weronikaolejniczak
Copy link
Copy Markdown
Contributor

@weronikaolejniczak weronikaolejniczak commented Jan 21, 2026

Summary

Improved EuiSelectable documentation around test environment, specifically how to apply a global mock that disables virtualization.

Why are we making this change?

Resolves #8740

There was an issue reported in EUI Slack some time ago about EuiSelectable not showing any options in jsdom unless isVirtualized={false} is passed. Recently, this issue has been bumped.

I thought about this for a while and I'm open to different opinions / suggestions. Personally, I think that while it's technically possible to "force" from our code EuiSelectable to not use virtualization in test environment, a better approach would be to let consumers mock it as needed.

If they are testing EuiSelectable directly (which is rarely I suppose) they can pass the prop directly. If they are testing a composition with EuiSelectable rendered, they can mock it with jest.mock (and clear the mocks if necessary) afterwards.

The issue has some more details in the comments ☝🏻

Impact to users

🟢 Dev-only change. Doesn't impact end users.

QA

Specific checklist

  • Verify the global mock works (unfortunately, Codesandbox doesn't support it... still)
  • Verify the documentation section is correct (staging)

General checklist

  • Browser QA
    • Checked in both light and dark modes
    • Checked in both MacOS and Windows high contrast modes
    • Checked in mobile
    • Checked in Chrome, Safari, Edge, and Firefox
    • Checked for accessibility including keyboard-only and screenreader modes
  • Docs site QA
  • Code quality checklist
  • Release checklist
    • A changelog entry exists and is marked appropriately
    • If applicable, added the breaking change issue label (and filled out the breaking change checklist)
    • If the changes unblock an issue in a different repo, smoke tested carefully (see Testing EUI features in Kibana ahead of time)
  • Designer checklist
    • If applicable, file an issue to update EUI's Figma library with any corresponding UI changes. (This is an internal repo, if you are external to Elastic, ask a maintainer to submit this request)

@weronikaolejniczak weronikaolejniczak self-assigned this Jan 21, 2026
@weronikaolejniczak weronikaolejniczak changed the title [EuiSelectable] Add global mock recommendation to documentation [EuiSelectable] Add global mock recommendation to docs Jan 21, 2026
@weronikaolejniczak weronikaolejniczak marked this pull request as ready for review January 21, 2026 10:39
@weronikaolejniczak weronikaolejniczak requested a review from a team as a code owner January 21, 2026 10:39
@weronikaolejniczak weronikaolejniczak force-pushed the fix/selectable-virtualized branch from 15654ff to df2c119 Compare January 21, 2026 10:48
@acstll acstll self-requested a review January 22, 2026 08:16
Copy link
Copy Markdown
Contributor

@acstll acstll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 The docs read clearly. I was able to test locally that the mock snippet works.

(Only a tiny suggestion.)

Co-authored-by: Arturo Castillo Delgado <arturo@arturu.com>
@elasticmachine
Copy link
Copy Markdown
Collaborator

💚 Build Succeeded

History

cc @weronikaolejniczak

@elasticmachine
Copy link
Copy Markdown
Collaborator

💚 Build Succeeded

History

cc @weronikaolejniczak

@weronikaolejniczak weronikaolejniczak merged commit 5418b2f into elastic:main Jan 22, 2026
5 checks passed
weronikaolejniczak added a commit to weronikaolejniczak/eui that referenced this pull request Jan 23, 2026
Co-authored-by: Arturo Castillo Delgado <arturo@arturu.com>
@weronikaolejniczak weronikaolejniczak deleted the fix/selectable-virtualized branch February 10, 2026 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[EuiSelectable] Doesn't render correctly in jsdom env

3 participants