Open cymplecy opened 9 months ago
Allowing the spinner to go down to 0 should be rather easy to change. Please try to change the minimum to 0
in this statement. I have not tried it yet!
Not sure how to solve this...
Here a bit of detailed explanation of how you can analyze something like this:
I manually enter 0 in the "output" input field:
I press the fullscreen button.
Then I see this error in my browser console window:
In the callstack you see that the error occurs in one of our js files, so click on that link to navigate to our related code.
Add a breakpoint to that statement.
Refresh the flow editor browser window, and repeat these steps again.
The debugger will halt a number of times on your breakpoint, but that is of no interest of us because it will only go wrong after we have changed the number of outputs.
Change the number of ouputs again to 0, and expand the workspace.
Now the debugger will halt again on your breakpoint, and you will see that the error occurs in a function that we use to dynamically fill a blockly dropdown:
Since the number of outputs is 0, the options
variable will contain an empty array.
Further on Blockly crashes on that and gives the error "FieldDropdown options must not be an empty array". So blockly doesn't want to show an empty dropdown, which makes sense...
It is about the dropdown where we show the output numbers:
When we have no outputs, this block in fact has no sense. But not sure how to handle that, in a non-confusing way for the user.
But of course your request makes sense...
@cymplecy, Any suggestions? Otherwise I need to ask on the Blockly forum whether they have any tips...
Sorry for delay in replying Changing min:0 works but as soon as I try and add blocks - goes wrong
I've not come up with any sensible ideas (we can't default outputs to 0) on how to deal with 0 without a lot of if else :(
I think, as its purely a visual issue that doesn't really matter that just best to not allow manual editing of that field and live with it
The number of outputs spinner doesn't let me select 0 outputs but I can type it in manually
But, if I do that and deploy then the block become un-editable and the interface locks up on me!
I was only wanting to do this to make a node look nicer so in future, I won't do it :)
But just mentioning it in case there's a quick fix