From f2c3e23632f12880a7407aafd1c3bf2df6e519a5 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 17 Jan 2020 10:29:07 -0500 Subject: [PATCH] clear search form upon changing results type tab This matches behavior from the Dojo interface. This will get modified a bit when adding support for default searches. TODO: Consider preserving the state of the search form so that it can be restored upon switch back to a given tab. Signed-off-by: Galen Charlton --- Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.component.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.component.ts index 4337a1dc18..52c8eaeeeb 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.component.ts @@ -56,6 +56,9 @@ export class AcqSearchComponent implements OnInit, AfterViewInit { this.onTabChange = ($event) => { if (this.validSearchTypes.includes($event.nextId)) { this.searchType = $event.nextId; + // clear search form upon tab change + this.searchTerms = []; + this.addSearchTerm(); this.router.navigate(['/staff', 'acq', 'search', $event.nextId]); } }; -- 2.11.0