mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-15 21:04:46 +01:00
fix (search): clear search after navigation action
This commit is contained in:
parent
28dd859b60
commit
3ee341caa4
1 changed files with 0 additions and 8 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue