1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

Finderを開き直したら内容初期化

This commit is contained in:
Rokt33r
2015-12-13 19:44:40 +09:00
parent af7f2d4d5e
commit 09f81fd0d6

View File

@@ -35,10 +35,17 @@ class FinderMain extends React.Component {
this.keyDownHandler = e => this.handleKeyDown(e)
document.addEventListener('keydown', this.keyDownHandler)
ReactDOM.findDOMNode(this.refs.finderInput.refs.input).focus()
this.focusHandler = e => {
let { dispatch } = this.props
dispatch(searchArticle(''))
}
window.addEventListener('focus', this.focusHandler)
}
componentWillUnmount () {
document.removeEventListener('keydown', this.keyDownHandler)
window.removeEventListener('focus', this.focusHandler)
}
handleKeyDown (e) {