Use setAttribute for setting the id instead of block.id as IE doesn't serialize the id otherwise. (#3604)

This commit is contained in:
Sam El-Husseini
2020-01-16 13:33:24 -08:00
committed by GitHub
parent 2f3716a022
commit 6c6296d74a

View File

@@ -146,7 +146,9 @@ Blockly.Xml.blockToDom = function(block, opt_noId) {
Blockly.utils.xml.createElement(block.isShadow() ? 'shadow' : 'block');
element.setAttribute('type', block.type);
if (!opt_noId) {
element.id = block.id;
// It's important to use setAttribute here otherwise IE11 won't serialize
// the block's id when domToText is called.
element.setAttribute('id', block.id);
}
if (block.mutationToDom) {
// Custom data for an advanced block.