diff --git a/awx/ui/client/src/organizations/linkout/addUsers/addUsers.controller.js b/awx/ui/client/src/organizations/linkout/addUsers/addUsers.controller.js index b45797a70b..e576ac5fd2 100644 --- a/awx/ui/client/src/organizations/linkout/addUsers/addUsers.controller.js +++ b/awx/ui/client/src/organizations/linkout/addUsers/addUsers.controller.js @@ -39,7 +39,12 @@ function($scope, $rootScope, ProcessErrors, GetBasePath, $scope.selectedItems.push(item.id); } else { - $scope.selectedItems = _.remove($scope.selectedItems, { id: item.id }); + // _.remove() Returns the new array of removed elements. + // This will pull all the values out of the array that don't + // match the deselected item effectively removing it + $scope.selectedItems = _.remove($scope.selectedItems, function(selectedItem) { + return selectedItem !== item.id; + }); } }); } diff --git a/awx/ui/client/src/organizations/linkout/addUsers/addUsers.partial.html b/awx/ui/client/src/organizations/linkout/addUsers/addUsers.partial.html index eb555b9dd8..df0d5233c6 100644 --- a/awx/ui/client/src/organizations/linkout/addUsers/addUsers.partial.html +++ b/awx/ui/client/src/organizations/linkout/addUsers/addUsers.partial.html @@ -27,7 +27,7 @@