{"action":"opened","issue":{"url":"https://api.github.com/repos/google/blockly/issues/1954","repository_url":"https://api.github.com/repos/google/blockly","labels_url":"https://api.github.com/repos/google/blockly/issues/1954/labels{/name}","comments_url":"https://api.github.com/repos/google/blockly/issues/1954/comments","events_url":"https://api.github.com/repos/google/blockly/issues/1954/events","html_url":"https://github.com/google/blockly/issues/1954","id":336582481,"node_id":"MDU6SXNzdWUzMzY1ODI0ODE=","number":1954,"title":"field_label modified in dynamic category resets when dragged onto workspace","user":{"login":"Marclev78","id":9289223,"node_id":"MDQ6VXNlcjkyODkyMjM=","avatar_url":"https://avatars2.githubusercontent.com/u/9289223?v=4","gravatar_id":"","url":"https://api.github.com/users/Marclev78","html_url":"https://github.com/Marclev78","followers_url":"https://api.github.com/users/Marclev78/followers","following_url":"https://api.github.com/users/Marclev78/following{/other_user}","gists_url":"https://api.github.com/users/Marclev78/gists{/gist_id}","starred_url":"https://api.github.com/users/Marclev78/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Marclev78/subscriptions","organizations_url":"https://api.github.com/users/Marclev78/orgs","repos_url":"https://api.github.com/users/Marclev78/repos","events_url":"https://api.github.com/users/Marclev78/events{/privacy}","received_events_url":"https://api.github.com/users/Marclev78/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-28T11:30:28Z","updated_at":"2018-06-28T11:30:28Z","closed_at":null,"author_association":"NONE","body":"<!--\r\n  - Thanks for opening an issue for us!  Before you open an issue,\r\n  - please check if a similar issue exists or has been closed before.\r\n  -\r\n  - If you're asking a question about how to use Blockly in your application,\r\n  - please ask questions on the mailing list, instead of filing issues:\r\n  -       https://groups.google.com/forum/#!forum/blockly\r\n  -->\r\n\r\nIf I modify a label in a dynamic catetory, it resets when I drag it onto the workspace.\r\n\r\n<!-- TODO: Please describe the problem.\r\n  -        Is it a bug report (something didn't work the way you expected),\r\n  -        or a feature request (something new you think would improve Blockly)?\r\n  -->\r\n\r\nGiven a block with a label like this:\r\n```\r\n  blocks[\"event_rule\"] = {\r\n    init: function() {\r\n      this.jsonInit({\r\n        message0: \"%1 events\",\r\n        message1: \"Rules: %1\",\r\n        args0: [\r\n          {\r\n            type: \"field_label\",\r\n            name: \"eventName\"\r\n          }\r\n        ],\r\n       .....\r\n```\r\nAnd a dynamic category with a block like:\r\n\r\n```\r\nconst blocks = [\r\n  `\r\n    <block type=\"event_rule\">\r\n      <field name=\"eventName\">${activeEvent}</field>\r\n    </block>\r\n  '\r\n];\r\n\r\nreturn blocks.map(block => `<xml>${block}</xml>`).map(block => Blockly.Xml.textToDom(block).firstChild);\r\n```\r\n\r\nThe flyout correctly shows the dynamically set label value.\r\n\r\nThe moment I drag the block from the flyout onto the workspace, it resets to `undefined`.\r\n\r\nIf I change the block type to `field_input`, it works fine. This is undesirable though, as I don't want it to appear as an input field, it's a dynamic part of the block description that I'm trying to change whenever the flyout is opened.\r\n\r\n"}}
{"actor":{"display_login":"Marclev78"}}