Before the $ionicHistory.goBack(); I’m checking if the keyboard is open. If the keyboard is open, close it, wait for it to be closed and then do $ionicHistory.goBack().
This seems to be issue if the last / current view has resize mode set to ionic.
More about the keyboard: