From afecdda8667c3b39cb87cd799eb8eff0b98ed899 Mon Sep 17 00:00:00 2001 From: Ashiv Gupta Date: Wed, 5 Dec 2018 14:56:03 +0530 Subject: [PATCH] fixed selecting item in grouplist --- isteven-multi-select.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/isteven-multi-select.js b/isteven-multi-select.js index c21075c..63b5b2c 100644 --- a/isteven-multi-select.js +++ b/isteven-multi-select.js @@ -422,17 +422,17 @@ angular.module( 'isteven-multi-select', ['ng'] ).directive( 'istevenMultiSelect' } // then set the clicked item to true - $scope.filteredModel[ index ][ $scope.tickProperty ] = true; + $scope.filteredModel[ index ][ $scope.tickProperty ] = true; + + // we refresh input model as well + var inputModelIndex = $scope.filteredModel[ index ][ $scope.indexProperty ]; + $scope.inputModel[ inputModelIndex ][ $scope.tickProperty ] = $scope.filteredModel[ index ][ $scope.tickProperty ]; } // Multiple else { $scope.filteredModel[ index ][ $scope.tickProperty ] = !$scope.filteredModel[ index ][ $scope.tickProperty ]; } - - // we refresh input model as well - var inputModelIndex = $scope.filteredModel[ index ][ $scope.indexProperty ]; - $scope.inputModel[ inputModelIndex ][ $scope.tickProperty ] = $scope.filteredModel[ index ][ $scope.tickProperty ]; } // we execute the callback function here