diff --git a/awx/ui/client/features/output/search.component.js b/awx/ui/client/features/output/search.component.js index bc446316f3..490b7c283e 100644 --- a/awx/ui/client/features/output/search.component.js +++ b/awx/ui/client/features/output/search.component.js @@ -64,9 +64,21 @@ function removeSearchTag (index) { } function submitSearch () { + // empty input, not submit new search, return. + if (!vm.value) { + return; + } + const currentQueryset = getCurrentQueryset(); + // check duplicate , see if search input already exists in current search tags + if (currentQueryset.search) { + if (currentQueryset.search.includes(vm.value)) { + return; + } + } const searchInputQueryset = qs.getSearchInputQueryset(vm.value, isFilterable); + const modifiedQueryset = qs.mergeQueryset(currentQueryset, searchInputQueryset); reloadQueryset(modifiedQueryset, strings.get('search.REJECT_INVALID'));