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

Broken css classes for custom toolbox icon in 9.0.0-beta.2 #6454

Closed
clementcontet opened this issue Sep 28, 2022 · 1 comment
Closed

Broken css classes for custom toolbox icon in 9.0.0-beta.2 #6454

clementcontet opened this issue Sep 28, 2022 · 1 comment
Assignees
Labels
issue: bug Describes why the code or behaviour is wrong type: regression

Comments

@clementcontet
Copy link
Contributor

Describe the bug

After migrating from 9.0.0-beta.1 to 9.0.0-beta.2, I get an error in console when loading my workspace.
It turns out that, as in https://blocklycodelabs.dev/codelabs/custom-toolbox/index.html#0, my toolbox custom icon css contains multiple classes (see https://github.com/Orange-OpenSource/super-coding-ball/blob/blockly9/src/assets/blocks/toolbox.json#L8).

This commit (5f11f34) changed the dom.addClass method to https://developer.mozilla.org/en-US/docs/Web/API/DOMTokenList/add
But apparently, in case of multiple classes, one needs to split them first, and pass them separately.

To Reproduce

Steps to reproduce the behavior:

  1. Clone https://github.com/Orange-OpenSource/super-coding-ball/tree/blockly9
  2. npm force install
  3. ng serve
  4. Go to "offline play" and choose any opponent

Desktop (please complete the following information):

  • Chrome
  • Version 9.0.0-beta.2

Stack Traces

core.mjs:6485 ERROR DOMException: Failed to execute 'add' on 'DOMTokenList': The token provided ('customIcon customIconEvents') contains HTML space characters, which are not valid in tokens.
    at CustomCategory.createIconDom_ (http://localhost:4200/vendor.js:10984:372)
    at CustomCategory.createDom_ (http://localhost:4200/vendor.js:10982:295)
    at CustomCategory.init (http://localhost:4200/vendor.js:10979:626)
    at Toolbox$$module$build$src$core$toolbox$toolbox.createToolboxItem_ (http://localhost:4200/vendor.js:11010:232)
    at Toolbox$$module$build$src$core$toolbox$toolbox.renderContents_ (http://localhost:4200/vendor.js:11009:348)
    at Toolbox$$module$build$src$core$toolbox$toolbox.render (http://localhost:4200/vendor.js:11009:180)
    at Toolbox$$module$build$src$core$toolbox$toolbox.init (http://localhost:4200/vendor.js:11002:349)
    at init$$module$build$src$core$inject (http://localhost:4200/vendor.js:10478:466)
    at Object.inject$$module$build$src$core$inject [as inject] (http://localhost:4200/vendor.js:10474:62)
    at BlocklyComponent.setWorkspaceForEdition (http://localhost:4200/main.js:505:63)
@clementcontet clementcontet added the issue: triage Issues awaiting triage by a Blockly team member label Sep 28, 2022
@BeksOmega BeksOmega added this to the 2022_q3_release milestone Sep 28, 2022
@BeksOmega BeksOmega added issue: bug Describes why the code or behaviour is wrong type: regression and removed issue: triage Issues awaiting triage by a Blockly team member labels Sep 28, 2022
@BeksOmega BeksOmega self-assigned this Sep 28, 2022
@BeksOmega
Copy link
Collaborator

Fixed by #6455

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug Describes why the code or behaviour is wrong type: regression
Projects
None yet
Development

No branches or pull requests

2 participants