0

I am searching for a method from blockly which will take the user input text given from a modal popup into the block.

Can you help me with this. thanks

  • Your question is very unclear. [You need to provide an Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve). – Hassan Siddiqui Apr 12 '19 at 10:03
  • Sorry for that. My question is that a user enters some text from a opened popup modal in google blockly . So using which function or method of blocklly i can capture the input and append into that block . – Sahithi Mangena Apr 12 '19 at 10:07

1 Answers1

0

You will have to add a new label field into the block programatically with the entered text as the value.

If you have the block and the entered text references, then you can use the below function -

addTextIntoBlock = function(block,text) {
  block.inputList[0].appendField(new Blockly.FieldLabel(text));
}
Nithin Kumar Biliya
  • 2,763
  • 3
  • 34
  • 54