diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c7375be4c4..763c71e967b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # [`master`](https://github.com/elastic/eui/tree/master) - `EuiInMemoryTable` pass items to BasicTable when message is provided ([#517](https://github.com/elastic/eui/pull/517)). +- `EuiSearchBox` now passes unused props through to `EuiFieldSearch` ([#514](https://github.com/elastic/eui/pull/514)) # [`0.0.27`](https://github.com/elastic/eui/tree/v0.0.27) diff --git a/src/components/basic_table/__snapshots__/in_memory_table.test.js.snap b/src/components/basic_table/__snapshots__/in_memory_table.test.js.snap index d47b93f029b..9cab63fd587 100644 --- a/src/components/basic_table/__snapshots__/in_memory_table.test.js.snap +++ b/src/components/basic_table/__snapshots__/in_memory_table.test.js.snap @@ -523,6 +523,9 @@ exports[`EuiInMemoryTable with pagination, selection, sorting and configured sea { search: { defaultQuery: 'name:name1', box: { - incremental: true + incremental: true, + ...requiredProps }, filters: [ { diff --git a/src/components/search_bar/__snapshots__/search_bar.test.js.snap b/src/components/search_bar/__snapshots__/search_bar.test.js.snap index 894297d0f66..f3b856c6c55 100644 --- a/src/components/search_bar/__snapshots__/search_bar.test.js.snap +++ b/src/components/search_bar/__snapshots__/search_bar.test.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`SearchBar render - no config, no query 1`] = ` +exports[`SearchBar render - box 1`] = ` `; -exports[`SearchBar render - no query, custom box placeholder and incremental 1`] = ` +exports[`SearchBar render - no config, no query 1`] = ` { expect(component).toMatchSnapshot(); }); - test('render - no query, custom box placeholder and incremental', () => { + test('render - box', () => { const props = { - ...requiredProps, - config: { - box: { - placeholder: 'find something...', - incremental: false - } + box: { + placeholder: 'find something...', + incremental: false, + ...requiredProps }, onChange: () => {} }; diff --git a/src/components/search_bar/search_box.js b/src/components/search_bar/search_box.js index 1c64b75104a..cd46631e088 100644 --- a/src/components/search_bar/search_box.js +++ b/src/components/search_bar/search_box.js @@ -31,16 +31,27 @@ export class EuiSearchBox extends Component { } render() { + const { + placeholder, + query, + incremental, + onSearch, + isInvalid, + title, + ...rest + } = this.props; + return ( this.inputElement = input} fullWidth - placeholder={this.props.placeholder} - defaultValue={this.props.query} - incremental={this.props.incremental} - onSearch={(query) => this.props.onSearch(query)} - isInvalid={this.props.isInvalid} - title={this.props.title} + placeholder={placeholder} + defaultValue={query} + incremental={incremental} + onSearch={(query) => onSearch(query)} + isInvalid={isInvalid} + title={title} + {...rest} /> ); }