transition-challenge icon indicating copy to clipboard operation
transition-challenge copied to clipboard

Back / forward navigation by swiping off the left/right borders

Open mvasin opened this issue 7 years ago • 5 comments

There is at least one more web-specific pain point that's not addressed - the back / forward navigation by swiping off the left/right borders (instead of pressing back / forth buttons):

swipe

mvasin avatar Aug 15 '18 07:08 mvasin

ouch! every now and then this safari navigation comes back to bite me. Honestly its a pain that a browser has implemented and enforced such a high level concept 😢.

Since the pages are already rendered in the back case at-least it leaves very less opportunity to what we can do.

I'll try thinking something, and am open to suggestions

prateekbh avatar Aug 15 '18 15:08 prateekbh

What comes to mind is intercepting these swipe gestures and disabling entering transition in that case. Getting rid of this glitch (by glitch I mean showing entering transition when page was already displayed in its final appearance) would be good enough, I don't think we can do any better.

mvasin avatar Aug 15 '18 15:08 mvasin

One more idea to explore (I don't know if it will work) - preventDefault() this off the screen swipe and then programmatically trigger history back (or forth, if that was the case) move.

Or maybe just preventDefault() and that's it, as a quick hack. If a user really wants to go back, he'll press back button on browser chrome or will use website navigation.

mvasin avatar Aug 15 '18 19:08 mvasin

is there an event for these swipes?

prateekbh avatar Aug 15 '18 19:08 prateekbh

There is no event- although you can sense it occuring as raw touch events on the document. preventDefault won't help you here, there is literally no way to prevent navigation that I am aware of. Once again the joy of Safari bites back... :(

mseddon avatar Mar 06 '19 15:03 mseddon