You can place non-number in number inputs using relabel

The bug

Using relabel custom blocks, it's possible to place non-numbers in number inputs.

Steps to reproduce

  1. Create a custom block with a number input.
  2. Create another custom block with a text input.
  3. Enter some text inside the block with a text input.
  4. Right-click, then choose relabel.

Observed Behavior

Non-numbers are placed inside number inputs in the relabel output.

Expected Behavior

Non-numbers would not be placed inside number inputs in the relabel output.

Attachments

Screenshot 2024-03-25 211228

Do they really need to fix this? I don't see what is wrong with putting text in number-only inputs. You could already put the join block inside any number-only inputs to put text in it.

[scratchblocks]
(join ((block with a number input ()::list)::grey ring) [non number input]
[/scratchblocks]
image
this bug has existed in many forms, and wont be fixed

Perhaps one could even say “it’s not bug … it’s a feature”. From what I’ve understood, part of Snap! ‘s philosophy is making it easy to do what most users want to achieve most of the times, but if a user consciously chooses to circumvent gates and climb over fences, that’s totally OK.

@bh: FAQ?

Bh doesn't check his notifications, but dont ping jens either

Well, pinging bh can also just be used to ask him a question.

I mean, you can type text into the number input in the item of block, and dropdowns allow for text in number inputs. If they removed the ability to put text in number inputs, the existing scripts that utilize that feature would be broken.

Ugh, you really want me to write FAQs about suggested bugs that aren't bugs? I'm sure there are trillions of them.

True. Both parts.

We both read the forum pretty carefully. Jens lets me answer the easy ones, unless I mess up, which happens once a decade or so.