javascripttypescriptgojs

ERROR TypeError: c.show is not a function, when we double click the diagram or node


I'm facing an issue with gojs diagram, when double clicked on it, to edit the node name.I recently have upgraded my gojs version from v1.7.14 to v2.2.17. Here is the error stack trace for the same

core.mjs:8453 ERROR TypeError: c.show is not a function
at Og.doActivate (go-module.js:522:434)
at La.doMouseUp (go-module.js:314:273)
at Q.doMouseUp (go-module.js:616:118)
at a.bk (go-module.js:611:261)
at ZoneDelegate.invokeTask (zone.js:423:31)
at core.mjs:23924:55
at AsyncStackTaggingZoneSpec.onInvokeTask (core.mjs:23924:36)
at ZoneDelegate.invokeTask (zone.js:422:60)
at Object.onInvokeTask (core.mjs:24225:33)
at ZoneDelegate.invokeTask (zone.js:422:60)

I recently have upgraded my gojs version from v1.7.14 to v2.2.17, but the double click functionality on the node/diagram broke. Any idea on this? It would be of great help. TIA


Solution

  • The problem was caused in GoJS v2.0 by the removal of HTMLElements as permitted values for properties such as GraphObject.toolTip and GraphObject.contextMenu.

    That functionality has been replaced by the GoJS HTMLInfo class to provide a standardized way of interacting with HTMLElements. Please read https://gojs.net/latest/intro/HTMLInteraction.html#HTMLInfoClass and https://gojs.net/latest/api/symbols/HTMLInfo.html.

    So you will need to modify your code to wrap an HTMLInfo around your use of an HTMLElement.