Skip to content

Commit 09f81fd

Browse files
committed
Finderを開き直したら内容初期化
1 parent af7f2d4 commit 09f81fd

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

browser/finder/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,17 @@ class FinderMain extends React.Component {
3535
this.keyDownHandler = e => this.handleKeyDown(e)
3636
document.addEventListener('keydown', this.keyDownHandler)
3737
ReactDOM.findDOMNode(this.refs.finderInput.refs.input).focus()
38+
this.focusHandler = e => {
39+
let { dispatch } = this.props
40+
41+
dispatch(searchArticle(''))
42+
}
43+
window.addEventListener('focus', this.focusHandler)
3844
}
3945

4046
componentWillUnmount () {
4147
document.removeEventListener('keydown', this.keyDownHandler)
48+
window.removeEventListener('focus', this.focusHandler)
4249
}
4350

4451
handleKeyDown (e) {

0 commit comments

Comments
 (0)