eui
eui copied to clipboard
feat: Add `optionMatcher` prop to `EuiSelectable` and `EuiComboBox` components
Summary
This PR resolves #2199 by allowing passing a custom matcher function to EuiComboBox and EuiSelectable using the new optional optionMatcher prop.
I kept the tests the same, just moved code around to extract the specific filtering logic while keeping component internals intact and not overridable (like isPreFiltered logic), so consumers don't have to reimplement them.
QA
The default option matcher should behave exactly as before the prop was introduced.
- [ ] Compare option filtering of
EuiComboBoxon PR env and production and confirm there are no behavior changes - [ ] Compare option filtering of
EuiSelectableon PR env and production and confirm there are no behavior changes - [ ] Confirm the
Custom option matcherexample usesstartsWithmatcher and only labels starting with search value are being matched
General checklist
- Docs site QA
- [x] Added documentation
- [x] Props have proper autodocs (using
@defaultif default values are missing) and playground toggles
- Code quality checklist
- Release checklist
- [x] A changelog entry exists and is marked appropriately.
Preview staging links for this PR:
- Docs site: https://eui.elastic.co/pr_7709/
- Storybook: https://eui.elastic.co/pr_7709/storybook
:green_heart: Build Succeeded
- Buildkite Build
- Commit: d718bf78936aba3d3758f9b4a2480d2ddc971a8c
History
- :green_heart: Build #1823 succeeded 6cc9f8a9d45debf8a2334fa983616c8587703f9d
- :green_heart: Build #1822 succeeded 835bac39a663d70161a3484e5efc7a9ea36d2d06
cc @tkajtoch