New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Number block accepts non-number value #1238
Comments
Refer to this line I wondered why we use |
@ColinTree The implementation of the number block in App Inventor predates the implementation of |
Additional testing indicates that this is a display problem. The change event for the number block is never called, and the stored value is not saved. The block displays as if it has changed until the project is reloaded. |
Dug into this a bit b/c fields are my jam. Turns out this is a bug inside Blockly, but it's fixed in the latest version. Explanation of why this occurs:
It could be fixed by monkey-patching the individual field's setValue function. Or by monkey-patching Blockly.Field's setValue function. But those aren't great options :/ |
@BeksOmega I would just go ahead and monkey patch it. |
Typically, the number block rejects values that do not parse as numbers. For example, typing
cat
and pressing enter will reject the string and revert the block to its original value. However, if one clicks on the workspace background the block will accept the change.The text was updated successfully, but these errors were encountered: