Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EuiSearchBar] Export onChange type #4968

Merged
merged 5 commits into from
Jul 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@
- Added `markdownFormatProps` prop to `EuiMarkdownEditor` to extend the props passed to the rendered `EuiMarkdownFormat` ([#4663](https://github.com/elastic/eui/pull/4663))
- Added optional virtualized line rendering to `EuiCodeBlock` ([#4952](https://github.com/elastic/eui/pull/4952))
- Added `current` as a `status` of `EuiHorizontalStep` ([#4911](https://github.com/elastic/eui/pull/4911))
- Exported `onChange` type for `EuiSearchBar` ([#4968](https://github.com/elastic/eui/pull/4968))

**Bug fixes**

1 change: 1 addition & 0 deletions src/components/search_bar/index.ts
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@
export {
EuiSearchBar,
EuiSearchBarProps,
EuiSearchBarOnChangeArgs,
QueryType,
Query,
Ast,
4 changes: 3 additions & 1 deletion src/components/search_bar/search_bar.tsx
Original file line number Diff line number Diff line change
@@ -33,8 +33,10 @@ interface ArgsWithError {
error: Error;
}

export type EuiSearchBarOnChangeArgs = ArgsWithQuery | ArgsWithError;

export interface EuiSearchBarProps extends CommonProps {
onChange?: (args: ArgsWithQuery | ArgsWithError) => void | boolean;
onChange?: (args: EuiSearchBarOnChangeArgs) => void | boolean;

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