mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-09-06 20:54:26 +08:00
fix(search-playground): Search bar React conversion issue
This commit is contained in:
parent
d161aa9cf9
commit
21b9529063
1 changed files with 4 additions and 5 deletions
|
@ -5,6 +5,7 @@ classNames = require 'classnames'
|
|||
SearchSuggestionStore = require './search-suggestion-store'
|
||||
_ = require 'underscore-plus'
|
||||
|
||||
|
||||
class SearchBar extends React.Component
|
||||
@displayName = 'SearchBar'
|
||||
|
||||
|
@ -78,8 +79,7 @@ class SearchBar extends React.Component
|
|||
</div>
|
||||
|
||||
_onFocusSearch: =>
|
||||
return unless @isMounted()
|
||||
@refs.searchInput.findDOMNode().focus()
|
||||
React.findDOMNode(@refs.searchInput).focus()
|
||||
|
||||
_containerClasses: =>
|
||||
classNames
|
||||
|
@ -125,7 +125,7 @@ class SearchBar extends React.Component
|
|||
|
||||
_clearAndBlur: =>
|
||||
@_onClearSearch()
|
||||
@refs.searchInput?.findDOMNode().blur()
|
||||
React.findDOMNode(@refs.searchInput)?.blur()
|
||||
|
||||
_onFocus: =>
|
||||
@setState focused: true
|
||||
|
@ -136,8 +136,7 @@ class SearchBar extends React.Component
|
|||
# handle the touch event, then dismiss the menu.
|
||||
setTimeout =>
|
||||
Actions.searchBlurred()
|
||||
if @isMounted()
|
||||
@setState focused: false
|
||||
@setState(focused: false)
|
||||
, 150
|
||||
|
||||
_doSearch: =>
|
||||
|
|
Loading…
Add table
Reference in a new issue