mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-18 03:01:05 +01:00
Fix submission of empty search queries (#1769)
Fixes submission of OmniSearch with an empty query or one which contains only a single character.
This commit is contained in:
@@ -353,8 +353,10 @@ const OmniSearch: FC = () => {
|
||||
const clearQuery = () => setQuery("");
|
||||
|
||||
const gotoDetailSearch = () => {
|
||||
history.push(`/search/${searchType}/?q=${query}`);
|
||||
hideResults();
|
||||
if (query.length > 1) {
|
||||
history.push(`/search/${searchType}/?q=${query}`);
|
||||
hideResults();
|
||||
}
|
||||
};
|
||||
|
||||
const { onKeyDown, index } = useKeyBoardNavigation(gotoDetailSearch, clearQuery, data?._embedded.hits);
|
||||
|
||||
Reference in New Issue
Block a user