-
Notifications
You must be signed in to change notification settings - Fork 0
[DRAFT - DO NOT MERGE] Use Blockly grid dropdown plugin #9
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
base: blockly-keyboard-experiment
Are you sure you want to change the base?
Conversation
Deploying review-pxt with
|
| Latest commit: |
8ae7359
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://40cd5760.review-pxt.pages.dev |
| Branch Preview URL: | https://blockly-grid.review-pxt.pages.dev |
| if (options.sort) { | ||
| options.data.sort() | ||
| } | ||
| super(text, {...options, columns: "4"}, validator); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not very nice. Also not sure why columns isn't already on the options object?
| const div = el as HTMLDivElement; | ||
| div.classList.add("blocklyDropDownButton"); | ||
|
|
||
| // We need to find where this occurs and handle it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And for the field_images.ts file as well.
|
This is all rather horrible. The icon grid appears to be pixel perfect compared with the original. The gesture images are less so. There's something about the inherent browser styling of the button element that I can't completely match. The border colour is also wrong, but could be fixed. |
A potential (low effort?) alternative to #8
The grid items look a bit odd due to a mixture of CSS that could be easily tweaked and the img attributes that MakeCode supply being taken seriously. The image data provided to the field editor is with height and width at 36px which is not straight forward to fix with CSS overrides as MakeCode normally uses 80% for this value rather than a hardcoded value in pixels.
Some things might be broken. I guess the proper way to do this is to have an internal FieldGridDropdown that extends Blockly.FieldGridDropdown, following the pattern for the FieldDropdown.