Search improves (#67)
* ESC should go back from search using direct onKeyDown here as react-keydown does not trigger within an input * Addressable search urls
This commit is contained in:
@ -1,15 +1,13 @@
|
||||
// @flow
|
||||
import React, { PropTypes } from 'react';
|
||||
import { observer } from 'mobx-react';
|
||||
|
||||
import React, { Component } from 'react';
|
||||
import styles from './SearchField.scss';
|
||||
|
||||
@observer class SearchField extends React.Component {
|
||||
static propTypes = {
|
||||
onChange: PropTypes.func,
|
||||
class SearchField extends Component {
|
||||
props: {
|
||||
onChange: Function,
|
||||
};
|
||||
|
||||
onChange = (event: SyntheticEvent) => {
|
||||
handleChange = (event: SyntheticEvent) => {
|
||||
event.currentTarget.value && this.props.onChange(event.currentTarget.value);
|
||||
};
|
||||
|
||||
@ -17,7 +15,8 @@ import styles from './SearchField.scss';
|
||||
return (
|
||||
<div className={styles.container}>
|
||||
<input
|
||||
onChange={this.onChange}
|
||||
{...this.props}
|
||||
onChange={this.handleChange}
|
||||
className={styles.field}
|
||||
placeholder="Search"
|
||||
autoFocus
|
||||
|
Reference in New Issue
Block a user