1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-21 05:31:45 +00:00

Key入力追加

This commit is contained in:
Rokt33r
2015-10-31 18:21:42 +09:00
parent 3d0b79f674
commit 954e148be3
10 changed files with 164 additions and 31 deletions

View File

@@ -4,16 +4,29 @@ import ExternalLink from 'boost/components/ExternalLink'
import { setSearchFilter } from 'boost/actions'
export default class ArticleTopBar extends React.Component {
isInputFocused () {
return document.activeElement === ReactDOM.findDOMNode(this.refs.searchInput)
}
focusInput () {
ReactDOM.findDOMNode(this.refs.searchInput).focus()
}
blurInput () {
ReactDOM.findDOMNode(this.refs.searchInput).blur()
}
handleSearchChange (e) {
let { dispatch } = this.props
dispatch(setSearchFilter(e.target.value))
}
handleSearchClearButton (e) {
let { dispatch } = this.props
dispatch(setSearchFilter(''))
ReactDOM.findDOMNode(this.refs.searchInput).focus()
this.focusInput()
}
render () {