Skip to content

Commit de7bdb0

Browse files
[EuiSearchBar] Export onChange type (#4968)
* euisearchbaronchangeargs * CL Co-authored-by: Chandler Prall <chandler.prall@gmail.com>
1 parent 42959cb commit de7bdb0

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- Added `markdownFormatProps` prop to `EuiMarkdownEditor` to extend the props passed to the rendered `EuiMarkdownFormat` ([#4663](https://github.com/elastic/eui/pull/4663))
99
- Added optional virtualized line rendering to `EuiCodeBlock` ([#4952](https://github.com/elastic/eui/pull/4952))
1010
- Added `current` as a `status` of `EuiHorizontalStep` ([#4911](https://github.com/elastic/eui/pull/4911))
11+
- Exported `onChange` type for `EuiSearchBar` ([#4968](https://github.com/elastic/eui/pull/4968))
1112

1213
**Bug fixes**
1314

src/components/search_bar/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
export {
1010
EuiSearchBar,
1111
EuiSearchBarProps,
12+
EuiSearchBarOnChangeArgs,
1213
QueryType,
1314
Query,
1415
Ast,

src/components/search_bar/search_bar.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ interface ArgsWithError {
3333
error: Error;
3434
}
3535

36+
export type EuiSearchBarOnChangeArgs = ArgsWithQuery | ArgsWithError;
37+
3638
export interface EuiSearchBarProps extends CommonProps {
37-
onChange?: (args: ArgsWithQuery | ArgsWithError) => void | boolean;
39+
onChange?: (args: EuiSearchBarOnChangeArgs) => void | boolean;
3840

3941
/**
4042
The initial query the bar will hold when first mounted

0 commit comments

Comments
 (0)