Only push onBlur if props available
This commit is contained in:
@ -55,7 +55,7 @@ class SearchForm extends React.Component{
|
||||
type="text"
|
||||
placeholder={this.props.term ? this.props.term : "Search..."}
|
||||
onChange={e => this.setState({term: e.target.value})}
|
||||
onBlur={e => this.props.onBlur(this.state.term)}
|
||||
onBlur={e => (this.props.onBlur !== undefined ? this.props.onBlur(this.state.term) : null)}
|
||||
value={ this.state.term }
|
||||
/>
|
||||
</label>
|
||||
|
||||
@ -396,7 +396,6 @@ class Search extends React.Component{
|
||||
<SearchForm
|
||||
history={this.props.history}
|
||||
term={this.state.term}
|
||||
//onBlur={term => this.setState({term: term})}
|
||||
onSubmit={term => this.handleSubmit(term)}
|
||||
/>
|
||||
|
||||
|
||||
@ -201,7 +201,7 @@ h2 {
|
||||
font-weight: 400;
|
||||
font-size: 2rem;
|
||||
line-height: 2.2rem;
|
||||
letter-spacing: -0.15rem;
|
||||
letter-spacing: -0.08rem;
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
|
||||
Reference in New Issue
Block a user