diff --git a/CHANGELOG.md b/CHANGELOG.md index 79895090557..6bd92990b9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## [`master`](https://github.com/elastic/eui/tree/master) +- Passed `getSelectedOptionForSearchValue` to `EuiComboBoxOptionsList` as prop ([#3501](https://github.com/elastic/eui/pull/3501)) - Added `appendIconComponentCache` function to allow manual pre-emptive loading of source elements into the `EuiIcon` cache ([#3481](https://github.com/elastic/eui/pull/3481)) - Added `initialSelected` to `EuiTableSelectionType` properties to set initial selected checkboxes for `EuiBasicTable` ([#3418](https://github.com/elastic/eui/pull/3418)) - Added exports for `EuiSteps` and related components types ([#3471](https://github.com/elastic/eui/pull/3471)) diff --git a/src/components/combo_box/__snapshots__/combo_box.test.tsx.snap b/src/components/combo_box/__snapshots__/combo_box.test.tsx.snap index 6d6cedcf6f5..b40969f0790 100644 --- a/src/components/combo_box/__snapshots__/combo_box.test.tsx.snap +++ b/src/components/combo_box/__snapshots__/combo_box.test.tsx.snap @@ -451,6 +451,7 @@ exports[`props singleSelection prepend and append is rendered 1`] = ` areAllOptionsSelected={false} data-test-subj="" fullWidth={false} + getSelectedOptionForSearchValue={[Function]} listRef={[Function]} matchingOptions={ Array [ @@ -584,6 +585,7 @@ exports[`props singleSelection selects existing option when opened 1`] = ` areAllOptionsSelected={false} data-test-subj="" fullWidth={false} + getSelectedOptionForSearchValue={[Function]} listRef={[Function]} matchingOptions={ Array [ diff --git a/src/components/combo_box/combo_box.tsx b/src/components/combo_box/combo_box.tsx index e58c2536e2e..96966b8698a 100644 --- a/src/components/combo_box/combo_box.tsx +++ b/src/components/combo_box/combo_box.tsx @@ -993,6 +993,7 @@ export class EuiComboBox extends Component< updatePosition={this.updatePosition} width={width} delimiter={delimiter} + getSelectedOptionForSearchValue={getSelectedOptionForSearchValue} /> ); diff --git a/src/components/combo_box/combo_box_options_list/combo_box_options_list.tsx b/src/components/combo_box/combo_box_options_list/combo_box_options_list.tsx index 62c9df1a3eb..1c30e3aa1a4 100644 --- a/src/components/combo_box/combo_box_options_list/combo_box_options_list.tsx +++ b/src/components/combo_box/combo_box_options_list/combo_box_options_list.tsx @@ -67,7 +67,7 @@ export type EuiComboBoxOptionsListProps = CommonProps & getSelectedOptionForSearchValue?: ( searchValue: string, selectedOptions: any[] - ) => EuiComboBoxOptionOption; + ) => EuiComboBoxOptionOption | undefined; isLoading?: boolean; listRef: RefCallback; matchingOptions: Array>;