Add `searchDisabledChoices` configuration option to allow disabled choices to appear in search results
Description
This adds a new configuration option searchDisabledChoices that allows disabled choices to appear in search results while remaining non-selectable.
Previously, disabled choices were always excluded from search results via the Store's searchableChoices getter. This made it impossible for users to find disabled options even when they wanted to see what options exist but are currently unavailable.
Changes:
- Add searchDisabledChoices option to Options interface (default: false)
- Update Store.searchableChoices getter to respect the new config
- Add test coverage for the new functionality
- Maintain backward compatibility with default behavior
The selection prevention logic in _handleChoiceAction already prevents disabled choices from being selected, so they remain non-selectable even when found in search results.
Fixes the limitation where users couldn't search for disabled options to see what choices exist but are currently unavailable.
Screenshots
https://github.com/user-attachments/assets/db120f07-eec5-4186-a37c-3668ee125a35
Types of changes
- [ ] Chore (tooling change or documentation change)
- [ ] Refactor (non-breaking change which maintains existing functionality)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
Checklist
- [x] My code follows the code style of this project.
- [x] I have added new tests for the bug I fixed/the new feature I added.
- [ ] I have modified existing tests for the bug I fixed/the new feature I added.
- [x] My change requires a change to the documentation.
- [x] I have updated the documentation accordingly.
The failing e2e test is from a random browser update and now some icons render differently, that can be ignored
Hey @Xon - thanks for reviewing my PR!
Just wanted to touch base real quick, and see if there's anything you need from me that could be preventing this from making into a release.
Thanks!