-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Closed
Labels
injectionissue: bugDescribes why the code or behaviour is wrongDescribes why the code or behaviour is wrong
Description
Check for duplicates
- I have searched for similar issues before opening a new one.
Description
Block IDs are not guaranteed to be re-generated when inserting a block from the flyout, and can even be duplicated in other contexts (such as with the minimap plugin--see RaspberryPiFoundation/blockly-samples#2512).
Note that this issue here is not that IDs are reused, it's that the focus system can have multiple nodes with identical IDs. This can result in unpredictable or outright incorrect behavior (see RaspberryPiFoundation/blockly-keyboard-experimentation#521 for one example of what can happen when IDs are duplicated).
The fix here isn't to change core behavior but, rather, to change what the focus system relies upon.
Reproduction steps
- Open the simple test playground for the latest version of v12.
- Add a block from the flyout.
- Observe that the block's ID in the workspace is the same as it was in the flyout.
Stack trace
Screenshots
No response
Browsers
No response
Metadata
Metadata
Assignees
Labels
injectionissue: bugDescribes why the code or behaviour is wrongDescribes why the code or behaviour is wrong