eui icon indicating copy to clipboard operation
eui copied to clipboard

feat: Add `optionMatcher` prop to `EuiSelectable` and `EuiComboBox` components

Open tkajtoch opened this issue 1 year ago • 2 comments

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 EuiComboBox on PR env and production and confirm there are no behavior changes
  • [ ] Compare option filtering of EuiSelectable on PR env and production and confirm there are no behavior changes
  • [ ] Confirm the Custom option matcher example uses startsWith matcher and only labels starting with search value are being matched

General checklist

  • Docs site QA
  • Code quality checklist
  • Release checklist
    • [x] A changelog entry exists and is marked appropriately.

tkajtoch avatar Apr 24 '24 14:04 tkajtoch

Preview staging links for this PR:

  • Docs site: https://eui.elastic.co/pr_7709/
  • Storybook: https://eui.elastic.co/pr_7709/storybook

kibanamachine avatar Apr 29 '24 14:04 kibanamachine

:green_heart: Build Succeeded

History

  • :green_heart: Build #1823 succeeded 6cc9f8a9d45debf8a2334fa983616c8587703f9d
  • :green_heart: Build #1822 succeeded 835bac39a663d70161a3484e5efc7a9ea36d2d06

cc @tkajtoch

elasticmachine avatar Apr 29 '24 14:04 elasticmachine