From 45ec3eb84d3b90fb8ebad59e14dc546391c83789 Mon Sep 17 00:00:00 2001 From: Akira Sudoh Date: Mon, 14 Sep 2020 16:41:20 +0900 Subject: [PATCH] fix(masthead-search): no redirect on empty value This change ensures redirect to dedicated search page upon clicking on the loupe icon happens only when there is a search query in the input box. Refs #3883. --- .../web-components/src/components/masthead/masthead-search.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/web-components/src/components/masthead/masthead-search.ts b/packages/web-components/src/components/masthead/masthead-search.ts index 12855a45a65..b3e4c80d490 100644 --- a/packages/web-components/src/components/masthead/masthead-search.ts +++ b/packages/web-components/src/components/masthead/masthead-search.ts @@ -88,7 +88,9 @@ class DDSMastheadSearch extends BXDropdown { private async _handleClickSearchButton() { const { active } = this; if (active) { - this._handleUserInitiatedRedirect(); + if (this._searchInputNode.value) { + this._handleUserInitiatedRedirect(); + } } else { this.active = true; await this.updateComplete;