mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-17 11:41:44 +00:00
Finderを開き直したら内容初期化
This commit is contained in:
@@ -35,10 +35,17 @@ class FinderMain extends React.Component {
|
|||||||
this.keyDownHandler = e => this.handleKeyDown(e)
|
this.keyDownHandler = e => this.handleKeyDown(e)
|
||||||
document.addEventListener('keydown', this.keyDownHandler)
|
document.addEventListener('keydown', this.keyDownHandler)
|
||||||
ReactDOM.findDOMNode(this.refs.finderInput.refs.input).focus()
|
ReactDOM.findDOMNode(this.refs.finderInput.refs.input).focus()
|
||||||
|
this.focusHandler = e => {
|
||||||
|
let { dispatch } = this.props
|
||||||
|
|
||||||
|
dispatch(searchArticle(''))
|
||||||
|
}
|
||||||
|
window.addEventListener('focus', this.focusHandler)
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount () {
|
componentWillUnmount () {
|
||||||
document.removeEventListener('keydown', this.keyDownHandler)
|
document.removeEventListener('keydown', this.keyDownHandler)
|
||||||
|
window.removeEventListener('focus', this.focusHandler)
|
||||||
}
|
}
|
||||||
|
|
||||||
handleKeyDown (e) {
|
handleKeyDown (e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user