[EuiSelectable] Add global mock recommendation to docs#9330
Merged
weronikaolejniczak merged 2 commits intoelastic:mainfrom Jan 22, 2026
Merged
Conversation
15654ff to
df2c119
Compare
acstll
approved these changes
Jan 22, 2026
Contributor
acstll
left a comment
There was a problem hiding this comment.
🟢 The docs read clearly. I was able to test locally that the mock snippet works.
(Only a tiny suggestion.)
packages/website/docs/components/forms/selection/selectable.mdx
Outdated
Show resolved
Hide resolved
Co-authored-by: Arturo Castillo Delgado <arturo@arturu.com>
Collaborator
💚 Build SucceededHistory
|
Collaborator
💚 Build Succeeded
History
|
weronikaolejniczak
added a commit
to weronikaolejniczak/eui
that referenced
this pull request
Jan 23, 2026
Co-authored-by: Arturo Castillo Delgado <arturo@arturu.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Improved
EuiSelectabledocumentation 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
EuiSelectablenot showing any options in jsdom unlessisVirtualized={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
EuiSelectableto not use virtualization in test environment, a better approach would be to let consumers mock it as needed.If they are testing
EuiSelectabledirectly (which is rarely I suppose) they can pass the prop directly. If they are testing a composition withEuiSelectablerendered, they can mock it withjest.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
General checklist
@defaultif default values are missing) and playground toggles