List item is not taking tap


#1

I do not get list tap, when I follow certain steps in an app involving side menu.
The steps are below followed by a link to the sample code -

  1. From a screen that does not have a side menu, redirect to a screen which has one [Click Sign In button in my sample]
  2. Redirect back to the page which does not have side menu on click of a some element, BUT do not put menu-close as an attribute of that element [ Click on two different Logouts provided in my sample, one in the side menu list and the other in side menu footer to see two different behaviours ]
  3. Redirect back to the page that has the side menu, you will not be able to click on the list items [ Click Sign In button again ]

This is happening because the click is not going to the list’s ion-item but it stops on some other layer.

Code Sample - https://github.com/Dbms/IonicSample_1

Kindly, help to resolve this, as I do not want to close the menu before I move to the other screen.


#2

This is because the app thinks the side-menu is open, and there are things in place to prevent any interaction if the side-menu is open. What you could do is toggle the side menu when you navigate away from that views scope.

.controller('MenuCtrl', function($scope,$state,$ionicSideMenuDelegate) {
	$scope.logOut = function(){
		$state.go('firstPage');
	}


//When Scope is destroyed, set menu as close
  var closeMenu = function() {
    $ionicSideMenuDelegate.toggleLeft();
  };
    $scope.$on('$destroy', closeMenu)
})

#3

Thanks for the answer.
There is a slight noticeable jerk while transitioning to the new screen by this approach but I think I can live with it :wink:


#4

The only other thing I could think of it to actually add menu-close, which you don’t want to do.


#5

Yeah…I kind of did that and then came to know that it was not the ideal case for my application. I think the above is a totally fine solution anyways and should stick to it…