Calling scrollToPart twice can lead to error

I’ve found what seems to be a bug. I’ve managed to create a simple test case. If I modify the Org Chart Editor so the ‘Remove Role’ click handler is this

			  myDiagram.startTransaction("remove role");
			  myDiagram.commandHandler.scrollToPart();
                          myDiagram.commandHandler.deleteSelection();
			  myDiagram.commandHandler.scrollToPart();
			  myDiagram.commitTransaction("remove role");

Then I get an exception thrown saying ‘Collection was modified during iteration’ during the second call to scrollToPart. I believe this is causing us other issues with the diagram becoming unresponsive, although that’s not apparent in this test case

Actually if I pass in a part as a parameter to scrollToPart I no longer get the error but it doesn’t fix the issue we’re seeing in our app, so I don’t think the error is related to our problem

I have adjusted our code so the first scrollToPart is no longer called which fixes our problem. I think there is a problem somewhere in GoJS with that particular code sequence but it’s no longer an issue for us

Thanks for reporting that unusual bug. We’ll fix it for the next release.