pxt icon indicating copy to clipboard operation
pxt copied to clipboard

Dynamic enum values lost when editing code

Open hovavo opened this issue 1 year ago • 0 comments

Dynamic enum values reset to 0 once a change was made in the code.

To Reproduce

  1. Go to https://makecode.com/playground#language-create-enums
  2. Click 'Run'
  3. Add a 'Show $color' block from the 'Language' menu and give it a non-zero value (Blue or Yellow) 4.Switch to the JavaScript view
  4. Add an empty line at the end of the code
  5. Switch back to Blocks view
  6. The block displays the value Red (0), while the code shows otherwise
  7. When in actual projects, saving and reloading resets the value to 0 also in the code view resulting in real data loss Expected behavior
  8. Blocks and code values should be in sync
  9. Values should not be lost after reload

hovavo avatar Oct 21 '24 03:10 hovavo