Skip to content

Commit

Permalink
fix(masthead-search): no redirect when search input empty (#3939)
Browse files Browse the repository at this point in the history
### Related Ticket(s)

React version fix of #3932

<!-- React and Web Component deploy previews are enabled by default. -->
<!-- To enable additional available deploy previews, apply the following -->
<!-- labels for the corresponding package: -->
<!-- *** "package: vanilla": Vanilla -->
<!-- *** "package: services": Services -->
<!-- *** "package: utilities": Utilities -->
<!-- *** "package: styles": Carbon Expressive, React (Expressive) -->
<!-- *** "RTL": React (RTL) -->
<!-- *** "feature flag": React (experimental) -->
  • Loading branch information
kennylam authored Sep 14, 2020
1 parent 1a406ad commit efab1c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react/src/components/Masthead/MastheadSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ const MastheadSearch = ({
*
*/
function searchIconClick() {
if (state.isSearchOpen) {
if (state.isSearchOpen && state.val.length) {
root.parent.location.href = getRedirect(state.val);
} else {
dispatch({ type: 'setSearchOpen' });
Expand Down

0 comments on commit efab1c2

Please sign in to comment.