mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-09-12 23:54:45 +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'
|
SearchSuggestionStore = require './search-suggestion-store'
|
||||||
_ = require 'underscore-plus'
|
_ = require 'underscore-plus'
|
||||||
|
|
||||||
|
|
||||||
class SearchBar extends React.Component
|
class SearchBar extends React.Component
|
||||||
@displayName = 'SearchBar'
|
@displayName = 'SearchBar'
|
||||||
|
|
||||||
|
@ -78,8 +79,7 @@ class SearchBar extends React.Component
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
_onFocusSearch: =>
|
_onFocusSearch: =>
|
||||||
return unless @isMounted()
|
React.findDOMNode(@refs.searchInput).focus()
|
||||||
@refs.searchInput.findDOMNode().focus()
|
|
||||||
|
|
||||||
_containerClasses: =>
|
_containerClasses: =>
|
||||||
classNames
|
classNames
|
||||||
|
@ -125,7 +125,7 @@ class SearchBar extends React.Component
|
||||||
|
|
||||||
_clearAndBlur: =>
|
_clearAndBlur: =>
|
||||||
@_onClearSearch()
|
@_onClearSearch()
|
||||||
@refs.searchInput?.findDOMNode().blur()
|
React.findDOMNode(@refs.searchInput)?.blur()
|
||||||
|
|
||||||
_onFocus: =>
|
_onFocus: =>
|
||||||
@setState focused: true
|
@setState focused: true
|
||||||
|
@ -136,8 +136,7 @@ class SearchBar extends React.Component
|
||||||
# handle the touch event, then dismiss the menu.
|
# handle the touch event, then dismiss the menu.
|
||||||
setTimeout =>
|
setTimeout =>
|
||||||
Actions.searchBlurred()
|
Actions.searchBlurred()
|
||||||
if @isMounted()
|
@setState(focused: false)
|
||||||
@setState focused: false
|
|
||||||
, 150
|
, 150
|
||||||
|
|
||||||
_doSearch: =>
|
_doSearch: =>
|
||||||
|
|
Loading…
Add table
Reference in a new issue