Skip to content

Commit

Permalink
fix: getBlocksByType not filtering out insertion markers (google#5430)
Browse files Browse the repository at this point in the history
* maxInstance fix

* requested changes applied
  • Loading branch information
Apoorvgarg-creator authored Sep 9, 2021
1 parent c008bd0 commit dfba007
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/workspace.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,10 @@ Blockly.Workspace.prototype.getBlocksByType = function(type, ordered) {
}
blocks.sort(this.sortObjects_);
}
return blocks;

return blocks.filter(function(block) {
return !block.isInsertionMarker();
});
};

/**
Expand Down

0 comments on commit dfba007

Please sign in to comment.