I am creating a browser-based desktop application with a text view. The text view may contain long horizontal lines. In Chrome, doing a left swipe on a track pad will sometimes activate the history.back action and sometimes activate the scroll left action. This is more than a little annoying for our users.
How do I disable the history swipe actions so that swiping will only scroll?
Note that I already supply a custom pushstate event handler. And also that moving forward/backward in history has appropriate meaning in the app, so I can't just disable history.
From what I've seen, there is no officially-sanctioned way to fix this. Toggling swipe gestures is regulated at the system level, not at the browser, so the only way to disable them is to do so manually in the system preferences (turn off "swipe between pages" in System Preferences -> Trackpad -> More Gestures).
However, after searching for a little while, I stumbled upon a hack that uses JQuery's mousewheel.js to override the settings.
This plugin by Pablo Villalba of Teambox was the first implementation I found when searching for a plugin that implements such an override. Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With