microsoft / microsoft/pxt-microbit

The dynamic enumeration block display does not represent the value: ENUM_GET

Open
#5,334 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

blocks-authoring P2
Dominant language
TypeScript
Stars
804
Forks
721
Avg merge
2d 9h
Merged PRs (30d)
2

Description

Creating enumerations with blocks: ENUM_GET

Creating enumerations with blocks
https://makecode.com/defining-blocks#creating-enumerations-with-blocks
Playground example : Create Enums from Blocks

Describe the bug

Unchecked(Unselected) member on enums dropdown list.

  1. When add block
  2. When convert JavaSctipt to Blocks

To Reproduce

Steps to reproduce the behavior:

Add block

  1. Open playground example : Create Enums from Blocks
  2. Click on RUN
  3. Drop the Show number (Color) block from Language extension
  4. Unchecked Red on enums dropdown list

Convert

  1. Switch to JavaScript
  2. Edit code, language.showColor(Colors.Red) to language.showColor(Colors.Blue)
  3. Switch to Blocks, Red is displayed, not Blue

Expected behavior
The specified value is checked.

Screenshots

Red is displayed on block, but unchecked Red on dropdown list.
image

Coding Colors.Blue on JavaScript, but Red is displayed on block.
image
Convert to Blocks:
image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked “Create Enums from Blocks” playground example and reproduce the issue by adding the Language extension’s Show number (Color) block, then by converting Colors.Blue from JavaScript to Blocks. Trace the dynamic enumeration dropdown’s displayed and checked values; done when the selected enum value is displayed and checked correctly in both workflows.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.