From 4159100778e64c4ffc225d5ebddc710b8be5c87d Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Wed, 15 Jun 2016 16:38:01 -0400 Subject: [PATCH] Prevent the click event from bubbling up and keeping the dropdown visible on searches. --- awx/ui/client/src/search/tagSearch.controller.js | 3 ++- awx/ui/client/src/search/tagSearch.partial.html | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/awx/ui/client/src/search/tagSearch.controller.js b/awx/ui/client/src/search/tagSearch.controller.js index f8848e13a5..8715237e84 100644 --- a/awx/ui/client/src/search/tagSearch.controller.js +++ b/awx/ui/client/src/search/tagSearch.controller.js @@ -62,7 +62,7 @@ export default ['$scope', 'Refresh', 'tagSearchService', }; // triggers a refilter of the list with the newTag - $scope.addTag = function(type) { + $scope.addTag = function($event, type) { var newTag = tagSearchService .getTag($scope.currentSearchType, $scope.newSearchTag, @@ -81,6 +81,7 @@ export default ['$scope', 'Refresh', 'tagSearchService', tags.push(newTag); $scope.updateSearch(tags); } + $event.stopPropagation(); }; // triggers a refilter of the list without the oldTag diff --git a/awx/ui/client/src/search/tagSearch.partial.html b/awx/ui/client/src/search/tagSearch.partial.html index 76c435fd99..65798db4a4 100644 --- a/awx/ui/client/src/search/tagSearch.partial.html +++ b/awx/ui/client/src/search/tagSearch.partial.html @@ -29,7 +29,7 @@ placeholder="Search">
@@ -50,7 +50,7 @@ currentSearchType.type === 'select'">
+ ng-click="addTag($event, type)"> {{ type.label }}