From 1cfc328d84330115de0b59124bbb28844d512388 Mon Sep 17 00:00:00 2001 From: Felix Roos Date: Fri, 1 Jun 2018 13:29:31 +0200 Subject: [PATCH] fix: clear searchbar when changing asset group --- .../src/files/asset-list-pop/asset-list-pop.component.ts | 1 + packages/ui/src/list/searchbar/searchbar.component.ts | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/data/src/files/asset-list-pop/asset-list-pop.component.ts b/packages/data/src/files/asset-list-pop/asset-list-pop.component.ts index 414fed579..f53ab2237 100644 --- a/packages/data/src/files/asset-list-pop/asset-list-pop.component.ts +++ b/packages/data/src/files/asset-list-pop/asset-list-pop.component.ts @@ -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; diff --git a/packages/ui/src/list/searchbar/searchbar.component.ts b/packages/ui/src/list/searchbar/searchbar.component.ts index 4ab7d3e75..5738da423 100644 --- a/packages/ui/src/list/searchbar/searchbar.component.ts +++ b/packages/ui/src/list/searchbar/searchbar.component.ts @@ -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();