blockly-samples
blockly-samples copied to clipboard
Fix conflict when using field-grid-dropdown with field-colour
🐛 Fix: Register Conflict Between @blockly/field-grid-dropdown and @blockly/field-colour
This PR addresses an issue where using @blockly/field-grid-dropdown and @blockly/field-colour together would cause a Name "field_grid_dropdown" already registered error due to double registration.
🔧 Changes Made
- Introduced a new utility function
registerFieldGridDropdown()in@blockly/field-grid-dropdown. - Modified
@blockly/field-colourto import and callregisterFieldGridDropdown()explicitly. - Ensured that the dropdown field is only registered once and safely when needed.
✅ Benefits
- Avoids duplicate field registration errors.
- Improves modular use of Blockly plugins.
- Safer integration of multiple plugins across different projects.
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.