PLT-5190 fixing javasscript error on RHS (#5068)
* PLT-5190 fixing javasscript error on RHS * PLT-5190 fixing javasscript error on RHS
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
a5674b481d
Коммит
59d2d34279
@@ -2,7 +2,6 @@
|
||||
// See License.txt for license information.
|
||||
|
||||
import $ from 'jquery';
|
||||
import ReactDOM from 'react-dom';
|
||||
import Client from 'client/web_client.jsx';
|
||||
import * as AsyncClient from 'utils/async_client.jsx';
|
||||
import * as GlobalActions from 'actions/global_actions.jsx';
|
||||
@@ -124,8 +123,8 @@ export default class SearchBar extends React.Component {
|
||||
isMentionSearch,
|
||||
(data) => {
|
||||
this.setState({isSearching: false});
|
||||
if (Utils.isMobile()) {
|
||||
ReactDOM.findDOMNode(this.refs.search).value = '';
|
||||
if (Utils.isMobile() && this.search) {
|
||||
this.search.value = '';
|
||||
}
|
||||
|
||||
AppDispatcher.handleServerAction({
|
||||
@@ -147,7 +146,7 @@ export default class SearchBar extends React.Component {
|
||||
handleSubmit(e) {
|
||||
e.preventDefault();
|
||||
this.performSearch(this.state.searchTerm.trim());
|
||||
$(ReactDOM.findDOMNode(this.refs.search)).find('input').blur();
|
||||
$(this.search).find('input').blur();
|
||||
this.clearFocus();
|
||||
}
|
||||
|
||||
@@ -276,7 +275,9 @@ export default class SearchBar extends React.Component {
|
||||
>
|
||||
<span className='fa fa-search sidebar__search-icon'/>
|
||||
<SuggestionBox
|
||||
ref='search'
|
||||
ref={(search) => {
|
||||
this.search = search;
|
||||
}}
|
||||
className='form-control search-bar'
|
||||
placeholder={Utils.localizeMessage('search_bar.search', 'Search')}
|
||||
value={this.state.searchTerm}
|
||||
|
||||
Ссылка в новой задаче
Block a user