Skip to content

Commit

Permalink
fix: clear searchbar when changing asset group
Browse files Browse the repository at this point in the history
  • Loading branch information
felixroos committed Jun 1, 2018
1 parent 1b7af18 commit 1cfc328
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Expand Up @@ -54,6 +54,7 @@ export class AssetListPopComponent extends PopComponent implements OnInit {
}
this.groupChanged.emit(group);
if (this.searchbar) {
this.searchbar.clear();
this.searchbar.focusEvent.emit(true);
}
this.assetGroupID = group;
Expand Down
7 changes: 6 additions & 1 deletion packages/ui/src/list/searchbar/searchbar.component.ts
Expand Up @@ -58,10 +58,15 @@ export class SearchbarComponent implements AfterViewInit, Focus {
if (this.autofocus) {
this.focusEvent.emit(true);
}
this.query = '';
this.clear();
})
}

/** clears the input query */
clear() {
this.query = '';
}

/** prevents the event default and disables propagation */
preventDefault(e) {
e.preventDefault();
Expand Down

0 comments on commit 1cfc328

Please sign in to comment.