From d9593f223a4880f06fb82431f6ee21a2dd1f3fff Mon Sep 17 00:00:00 2001 From: Julie Knowles Date: Mon, 28 May 2018 11:40:50 -0700 Subject: [PATCH] fix(search-box): back arrow clears search (closes #1157) (#1158) * fix(search-box): back arrow clears search * fix(seach-box): actually clear the input --- src/platform/core/search/search-box/search-box.component.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/platform/core/search/search-box/search-box.component.ts b/src/platform/core/search/search-box/search-box.component.ts index e15277416e..08bf5200d2 100644 --- a/src/platform/core/search/search-box/search-box.component.ts +++ b/src/platform/core/search/search-box/search-box.component.ts @@ -118,7 +118,10 @@ export class TdSearchBoxComponent extends _TdSearchBoxMixinBase implements ICont * Method executed when the search icon is clicked. */ searchClicked(): void { - if (this.alwaysVisible || !this._searchVisible) { + if (!this.alwaysVisible && this._searchVisible) { + this.value = ''; + this.handleClear(); + } else if (this.alwaysVisible || !this._searchVisible) { this._searchInput.focus(); } this.toggleVisibility();