MacOS Safari undefined object error

Hi there,

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’)

With the error resulting from this line of code:

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.

Some help would be welcome, thanks in advance!

GoJS version: 2.2.16
Gojs-angular version: 2.0.6
Angular version: 17

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.

Could you do that cleanup a bit later?

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?

I’m sorry, you are absolutely correct. the screenshot was indeed from a 3.0 version of GoJS, I was trying if this would be fixed in a newer version.

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 ?

Oh, well, that’s much easier for both you and us. We’ll fix that for the next release. Thanks for reporting the problem in Safari.

Thanks, that would be great!

Try 3.0.10.

Works perfectly ! Thanks for the help and the quick new version.