Thank you, we’ll investigate a durable fix for this.
The problem is that this is not a specific gesture for iOS, but a feature of the wheel
event on any page: If you can scroll left or right on a webpage the trackpad will scroll your document left or right. But if you cannot scroll any more (and on most typical webpages you cannot scroll left or right at all), then browsers will trigger a page back or forward.
In GoJS, we use and disallow bubbling of all wheel
events needed for scrolling the Diagram, both in X and Y directions. But beyond that we allow them to bubble. The effect of this is that a user scrolling down on a Diagram will scroll the Diagram until it can be scrolled no more, then it will scroll the page.
But the same is true for scrolling leftwards: It will pan the diagram left, until it can be panned no more, than it will allow the wheel
events to bubble. The browser window receives those wheel events, and assumes that you want the browser page to go back.
So a very simple fix would be to stop any wheel event from bubbling. You could write this:
myDiagram.toolManager.standardMouseWheel = function () {
myDiagram.lastInput.bubbles = false;
go.ToolManager.prototype.standardMouseWheel.call(this);
}
But that also prevents scrolling (normally, up or down). To be a bit more careful, you could instead do this:
myDiagram.toolManager.standardMouseWheel = function () {
const oldpos = myDiagram.position.copy();
// Call default functionality
go.ToolManager.prototype.standardMouseWheel.call(this);
// If the diagram did not move, check direction of wheel scroll
if (myDiagram.position.equals(oldpos)) {
const e = myDiagram.lastInput.event;
if (e.deltaX !== 0) { // attempted left or right scroll
// disallow bubble, so that browser cannot commit `back` and `forward` page actions
myDiagram.lastInput.bubbles = false;
}
}
}
Like I said, we’ll investigate what to do for a library fix, but we have to carefully consider what all customers might want to do. This code will prevent page scrolling left and right as well. With that said, it may be a very acceptable workaround for you to implement.