Can we disable the swipe to go back on ios

I’m building a 1 page website and change “page” by changing the index’s state.

The problem is when ios user want to go back to previous page, they swipe back and it load their real “prrvious page” but not my website.

How can i disable that swipe to go back? Or is there any other solution for my case?

Thank you.

Try this see if it works (i don’t have a ios with me):


https://www.outsystems.com/forums/discussion/77514/disable-swipe-to-previous-screen-some-android-and-ios/

Go to plugins >>>
search for “Toolbox” >>>
install it>>>
create a new workflow of type on page load >>>
new workflow as pluging > Run Javascript > paste this code there

document.addEventListener(‘touchstart’, function(e) {
if (e.pageX > 10 && e.pageX < window.innerWidth - 10) return;
e.preventDefault();
});

unfortunatetly, it doesn’t work.

Yeah i suggest you keep searching for a javascript snippet that will do the trick.
If you don’t find any solution, i whould suggest you to invest in a good solid UI like a return link/buton so you can guide your user to use your UI insted.

1 Like

Hi there - I don’t have an answer for how specifically to disable IOS Swipe, but I wanted to suggest considering sending parameters to your URL as the user navigates, and setting the page state on Get Data From Page URL, which in theory would mean hitting ‘back’ or swiping on the browser should take them to where they were on your app, instead of their previous site.

2 Likes