diff --git a/embark-ui/src/components/SearchBar.js b/embark-ui/src/components/SearchBar.js index 72aa5fa1..02f20ddb 100644 --- a/embark-ui/src/components/SearchBar.js +++ b/embark-ui/src/components/SearchBar.js @@ -20,6 +20,17 @@ class SearchBar extends React.Component { }); } + onSubmit(e) { + e.preventDefault(); + this.props.searchSubmit(this.state.searchValue); + } + + onKeyPress(e) { + if (e.key === 'Enter') { + this.onSubmit(e); + } + } + render() { return ( @@ -27,8 +38,8 @@ class SearchBar extends React.Component {
this.onChange(e)} - value={this.state.searchValue}/> - diff --git a/embark-ui/src/components/search.css b/embark-ui/src/components/search.css index 53e1acc6..39c5673b 100644 --- a/embark-ui/src/components/search.css +++ b/embark-ui/src/components/search.css @@ -1,11 +1,12 @@ .search-bar { - margin-top: 10px; + margin: 10px 0; } .search-bar input { border-top-right-radius: 0; border-bottom-right-radius: 0; border: 0; + outline: none; } .search-bar button {