-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: $ionicConfig.views.swipeBackEnabled can't be changed #3470
Comments
Do you tried using $ionicHistory.nextViewOptions({
disableBack: true
}); I'm sure that with |
👍 |
You should be able to disable it in the state's controller. Something like: .controller('MyCtrl', function($scope, $ionicConfig) {
$scope.$on('$ionicView.enter', function(){
$ionicConfig.views.swipeBackEnabled(false);
})
$scope.$on('$ionicView.leave', function(){
$ionicConfig.views.swipeBackEnabled(true);
})
}); Does that do the trick? |
@perrygovier Thank your for your feedback. I added to the controller of the according state/view. However I still can swipe to leave the state/view. I tested on 1.0.0-rc.0 and 1.0.0-rc.3 |
@perrygovier This maybe along the same lines as #3281, where change the config value in the controller did nothing. If thats the case, this would be a bug and not a feature. Passing this to @adamdbradley |
Thank you for your work on this issue. .controller('MyCtrl', function($scope, $ionicConfig) {
$scope.$on('$ionicView.enter', function(){
$ionicConfig.views.swipeBackEnabled(false);
})
$scope.$on('$ionicView.leave', function(){
$ionicConfig.views.swipeBackEnabled(true);
})
}); |
@yankustefan neither works in rc.5 :-( |
Ah @yankustefan simply use |
+1 @yankustefan I have the following code (that I believe should be the default on iOS, but whatever) :
Not working :'( The problem I have is the following :
Is that clear enough ? I can make a video since it's pretty specific, if necessary. Regards Also pinging @adamdbradley |
following is not work .controller('MyCtrl', function($scope, $ionicConfig) { |
@seb0zz Have you tried programmatically? |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
Type: feat
Platform: ios 8 webview
Is it possible to disable "swipe to go back" on specific views?
I would like to disable it on forms, where I have implemented a confirmation before closing/moving away from the view.
See also Ionic forum thread: #18808
The text was updated successfully, but these errors were encountered: