fix (search): clear search after navigation action

This commit is contained in:
= 2019-04-18 16:15:28 +10:00
parent 28dd859b60
commit 3ee341caa4

View file

@ -5,8 +5,6 @@ import { Card, NgIf, Icon, EventEmitter, Dropdown, DropdownButton, DropdownList,
import { pathBuilder, debounce } from '../../helpers/';
import "./submenu.scss";
let SEARCH_KEYWORD = "";
@EventEmitter
export class Submenu extends React.Component {
constructor(props){
@ -16,11 +14,6 @@ export class Submenu extends React.Component {
search_keyword: ""
};
if(SEARCH_KEYWORD){
this.state.search_input_visible = true;
this.state.search_keyword = SEARCH_KEYWORD;
}
this.onSearchChange_Backpressure = debounce(this.onSearchChange, 400);
this._onEscapeKeyPress = (e) => {
if(e.keyCode === 27){ // escape key
@ -50,7 +43,6 @@ export class Submenu extends React.Component {
}
}
componentWillUnmount(){
SEARCH_KEYWORD = this.state.search_keyword;
window.removeEventListener('keydown', this._onEscapeKeyPress);
}