when clicking the third group, the second one is hidden but <ion-content> do not know that so it keeps the scrolling position as it is.
this is where $ionicScrollDelegate comes in.
add $ionicScrollDelegate to your controller then after you close and open the divs call its resize methode
angular.module('ionicApp', ['ionic'])
.controller('HomeCtrl', function($scope, $ionicModal, $ionicScrollDelegate) {
$scope.data = {
showGroup: null
};
$scope.isGroupShown = function(index) {
return $scope.data.showGroup == index;
};
$scope.toggle = function(index) {
if ($scope.isGroupShown(index)) {
$scope.data.showGroup = null;
} else {
$scope.data.showGroup = index;
}
$ionicScrollDelegate.resize();
};
})
$ionicScrollDelegate.resize(); will tell ion content to resize the scroll area to fit the elements inside it.
hope it helps