Merge branch '19079-search-results-open-newtab' into main. Closes #19079
[arvados-workbench2.git] / src / views-components / search-bar / search-bar-view.tsx
index 61efbcfe04bc56145632ec7f7fb7a6829f381e65..284083477f00e2f4c13f1d13cee483367bbbf630 100644 (file)
@@ -2,7 +2,7 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import * as React from 'react';
+import React from 'react';
 import { compose } from 'redux';
 import {
     IconButton,
@@ -128,10 +128,10 @@ const handleKeyDown = (e: React.KeyboardEvent, props: SearchBarViewProps) => {
 const handleInputClick = (e: React.MouseEvent, props: SearchBarViewProps) => {
     if (props.searchValue) {
         props.onSetView(SearchView.AUTOCOMPLETE);
-        props.openSearchView();
     } else {
-        props.closeView();
+        props.onSetView(SearchView.BASIC);
     }
+    props.openSearchView();
 };
 
 const handleDropdownClick = (e: React.MouseEvent, props: SearchBarViewProps) => {