Hmmm. It appears the code you are referencing is this:
myDiagram.addDiagramListener("ExternalObjectsDropped", function(e) {
// stop any ongoing text editing
if (myDiagram.currentTool instanceof go.TextEditingTool) {
myDiagram.currentTool.acceptText(go.TextEditingTool.LostFocus);
}
// expand any "macros"
myDiagram.commandHandler.ungroupSelection();
// start editing the first node that was dropped after ungrouping
var tb = myDiagram.selection.first().findObject('TEXT');
if (tb) myDiagram.commandHandler.editTextBlock(tb);
});
However, I can’t seem to get that to work. I have tried changing the listener to PartCreated, but that doesn’t call anything. In previous attempts, I have tried this:
var tb = node.findObject("ENTITY_TYPE");
if (tb) fileDiagram.commandHandler.editTextBlock(tb);
…but this seems to freeze the screen.
The code in the initial question is called using a function. I have several things call this function (i.e. context-menu, keyboard shortcuts, double-clicking the background) which creates the node. This is how I set this up for when the diagram is created.
Yes. I just ran it with the debug file and this is the error I get:
go-debug.js:12 Uncaught Error: CommandHandler.editTextBlock value is not an instance of TextBlock: Shape(Rectangle)#1154
at v (go-debug.js:12)
at Ba (go-debug.js:13)
at w (go-debug.js:12)
at LocalStorageCommandHandler.Sk.editTextBlock (go-debug.js:882)
at createNode (main.js:10037)
at doubleClick (main.js:10759)
at zf (go-debug.js:309)
at qh.vf.standardMouseClick (go-debug.js:307)
at qh.clickSelectingTool.standardMouseClick (main.js:10755)
at qh.doMouseUp (go-debug.js:485)