feat: Allow custom/angular navigation on swipe to go back
See original GitHub issueFeature Request
Ionic version: [x] 4.12.0
Describe the Feature Request
The swipe to go back feature is tightly coupled to the NavController
. I guess this is the culprit.
Since ionic 4 it seems to be the preferred way to directly use angular’s router for navigation (see e.g. here). So it would be nice to have a bit more control over this navigation event.
Describe Preferred Solution
Maybe one could pass the swipeHandler
on the directive. Something like:
// template
<ion-router-outlet [swipeHandler]="getSwipeHandler()"></ion-router-outlet>
// controller
getSwipeHandler() {
return {
canStart: () => { .. },
onStart: () => { .. },
onEnd: () => { .. }
};
}
One downside of this approach would be that one would have to take care of animations oneself.
Describe Alternatives
One could also disable this feature, expose swiper
and implement this feature oneself. But this seems a bit cumbersome.
Related Code See Describe Preferred Solution
Additional Context This is primarily relevant for iOS.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Hi Liam,
I just wanted you to know that I’m still here. Just didn’t have the time yet to create a sample repo. Hopefully I will be able to do it at latest next week. Sorry about that.
Cheers!
Thanks for the issue! This issue is being closed due to the lack of a reply. 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.
Thank you for using Ionic!