Cannot display the Grid programmatically on the first attempt

Hey, I am using this method to toggle the grid with the lastest version of gojs 3.0.7.

I noticed that to see the change take effect, I need to call this method 3 times in a row:

  • Initially: false
  • 1st call: true (Not displayed)
  • 2nd call: false
  • 3rd call: true (Displayed)
function toggleGrid(e, obj) {
    myDiagram.commit(() => {
      myDiagram.grid.visible = !myDiagram.grid.visible;
    }, "toggle grid");

I think this is either a regression or I missed something in the changelog of version 3.

This is definitely a bug, we’ll fix it and get back to you soon.

This has been fixed and will be out with the next release, probably early next week. Thanks for reporting.