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:
Tom Moor
2017-05-21 23:02:53 -07:00
committed by GitHub
parent 87adccb816
commit 3353eb913a
5 changed files with 55 additions and 21 deletions

View File

@ -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