google / blockly-android

Blockly for Android
Apache License 2.0
671 stars 209 forks source link

Numeric input and text input do not connect to existing blocks. Glitched block #720

Closed mo-patel closed 6 years ago

mo-patel commented 6 years ago

When the numeric or text input blocks are connected to a set of existing blocks, the input does not connect properly. when dragging, the yellow indicator which highlights a possible connection does not appear either. Due to this issue, when the code generator is ran, the number input that does not connect always appears at the end of the code.

screen shot 2018-03-11 at 10 35 40 screen shot 2018-03-11 at 10 21 18

Also, When the block is dropped, the number input changes into a long number automatically which can be seen in the picture below

screen shot 2018-03-11 at 10 20 39

.

The scenario can be replicated by using AbstractBlocklyActivity with demo_workspace

AnmAtAnm commented 6 years ago

You attempting are connecting a number block or a text block to a boolean input. Since these connections are incompatible, this is the correct behavior. Perhaps you want

if (numberValue != 0) { ... }

or

if (text.length == 0) { ... }