Skip to content
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

[Google Blockly] Customize variable dropdown options #43741

Merged
merged 4 commits into from Nov 22, 2021

Conversation

ajpal
Copy link
Contributor

@ajpal ajpal commented Nov 21, 2021

jira
Modeled largely after https://github.com/code-dot-org/blockly/blob/main/core/ui/fields/field_variable.js#L143, which was implemented by #7349

Adds a custom override class for Blockly.FieldVariable so that we can override dropdownCreate to add our custom rename options to the dropdown and onItemSelected_ to handle the logic for when the rename options are selected. I'm not sure why onItemSelected_ is a class method and dropdownCreate is not, but since that's the way it is in Blockly Core, I left it as is in the custom class.

Before
image
image

After
image
image
image

@ajpal ajpal requested a review from a team November 21, 2021 20:20
@ajpal ajpal requested a review from a team as a code owner November 21, 2021 20:20
@maddiedierker
Copy link
Contributor

@cat5inthecradle your question came through in an email, but isn't showing in the github UI for some reason:

Just curious, is ??? just your placeholder for a variable name, or does ??? have some specific meaning

"???" is the default placeholder for an unnamed variable. i can't remember if it's us or blockly that set this default

@cat5inthecradle
Copy link
Contributor

@madelynkasula I forgot how to github today 😅. That answer's my question! Thank you.

@maddiedierker maddiedierker merged commit b3c8179 into staging Nov 22, 2021
@maddiedierker maddiedierker deleted the nov21-blockly-var-rename branch November 22, 2021 17:56
snickell pushed a commit that referenced this pull request Feb 3, 2024
[Google Blockly] Customize variable dropdown options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants