We are currently experiencing a very specific problem which we cannot find a solution for.
We have simple GoJS diagram in a popup (Angular), whenever you double click on a node you ‘select’ a node and the popup closes. This works fine on any browser except on Safari on a Mac. This is a browser we want to support so we would like to solve this.
We found out that the problem is the most consistently reproducable in the doubleClick handler and then hiding a diagram. So what we did is we removed almost all code and put a simple ngIf=“showDiagram” around are diagram. Whenever we double click on a node showDiagram becomes false so the diagram is hidden/destroyed.
This scenario in Safari on Mac results in the following error: TypeError: undefined is not an object (evaluating ‘i.isEnabled’)
We tried various things, like setting the div to null, calling destroy manually, clearing selections and so on. But cannot find any way to find this issue.
I can’t find any minified function named “eR” in go.js v2.2.16. Maybe the minified go.js file was minified again?
Anyway, that method is actually an internal event listener for “pointerleave” events. I’m guessing that the order in which things happen is different in Safari, and the “pointerleave” event is happening after the Diagram has been removed from the DOM and cleaned up.
Is there any event that I can use that will come after the pointerleave event ? So i can try to work around this issue.
Or maybe even prevent the pointerleave event from being fired in the first place ?
Could you just change the code to avoid the exception?
if (!i || !i.isEnabled) return false;
Actually when I look at your screenshot, I’m rather unsure that the code comes from a go.js library file version 2.2. I’d guess it comes from GoJS v3.0. Are you sure about the version number?
The 2.2 version has the same problem though, only slightly different code. Altering the code would require us to make fork of GoJS, which seems like quite a big change for a very small problem. Is there anything we can disable so this internal handler does not execute ?