Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Select should not crash if getItems returns empty array #2623

Merged
merged 4 commits into from
Aug 10, 2024

Conversation

benj-dobs
Copy link
Contributor

Description

I have not added tests because I couldn't make the simple reproduction case from #2535 work in the test environment. I could reproduce it in Storybook, but this seemed like an odd thing to add to Storybook, so I didn't.

It's possible this solution is incomplete, but it fixes both of the above reproductions, so it's probably good enough for now.

@maxired
Copy link

maxired commented Jan 5, 2024

Hi. I am facing a similar crash on a use case similar to the one of #2535
I think that this fix make sens

@izhan
Copy link

izhan commented Feb 6, 2024

Our customers hit this error every single day. Is it possible to get this merged? Also happy to help out with this PR if it needs changes

@benj-dobs
Copy link
Contributor Author

In case anyone else is wondering about how maintainer activity seems to have just died without a word, there are some signs of life on the Discord:

https://discord.com/channels/752614004387610674/803656831704629298/1199950373650190336

No idea when this issue will get fixed but for now using patch-package or yarn resolutions is probably your best workaround.

@tomtomprince
Copy link

We're also facing this issue. Going the patch-package route for now but it'd be great to merge this in

@chaance
Copy link
Member

chaance commented Aug 9, 2024

Hey all! I'm back on the team and will be reviewing some old PRs, cleaning up the backlog in the coming weeks. This one's first on the list. Thanks for hanging with us 🙏

@chaance chaance merged commit 5105a22 into radix-ui:main Aug 10, 2024
5 checks passed
@benj-dobs benj-dobs deleted the select-empty-items branch August 10, 2024 23:29
@tatwater
Copy link

tatwater commented Aug 28, 2024

Hey @chaance for some reason this fix got undone in a more recent version 😢 Facing this issue again now that we're on v2.1.1 and the inspector shows that the source code has reverted to not checking that items has length before indexing into it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants