mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-21 05:31:45 +00:00
Key入力追加
This commit is contained in:
@@ -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 () {
|
||||
|
||||
Reference in New Issue
Block a user