-
Notifications
You must be signed in to change notification settings - Fork 585
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
Custom field dropdowns: shadow blocks are serializing functions not meant to be exposed #7834
Comments
Ahh, to my knowledge that field editor isn't actually used anywhere besides that example -- it might have just been built as a test (or as an example of how someone could author a field editor themselves) and then completely forgotten about. For reference the src for that field editor is https://github.com/microsoft/pxt/blob/master/pxtblocks/fields/field_textdropdown.ts; is this one that you intended to use or did you just happen to run into the bug while looking through the playground? re: the decompiled code including |
Yeah I am not using the textdropdown field editor (seems like it needs love). When I add it onto the playground example, notably the string does not serialize correctly.
|
Ok oddly for my case this works in the playground editor but not in the actual runtime. I just upgraded to pxt-core 6.0.1, but was reproing in 5. Richard says I should make the move to put my stuff in lib and out of sim, would that affect this?
|
Custom field editors are serializing out the contents of their shadow blocks instead of their literal values.
This serialization problem is also appearing in the BuildBee MakeCode color picker. I had to expose the shadow block in the API so that it would not look strange. But it looks like the feature is broken?
** PXT Playground Example **
Load up PXT playground, example field-editors-dropdowns
https://makecode.com/playground#field-editors-dropdowns
Hit the run button
Add the "Say hello" block
Flip the editor to Javascript
Expected
Since the __wordPicker function is marked as blockHidden, and it is a shadow field editor, I expect the correct serialization to be
time.say("Hello")
Actual
It seems to generate javascript that can't be compiled (this is worse than what I'm seeing on BuildBee using number types)
The text was updated successfully, but these errors were encountered: