Skip to content

Recursive block selects firing with v12 #9087

Closed

Description

@mikeharv

Check for duplicates

  • I have searched for similar issues before opening a new one.

Description

With v12.0.0, Blockly seems to be firing far more Blockly.Events.SELECTED events than normal. This is leading to performance issues.

Reproduction steps

  1. Visit any v12 demo page, such as https://google.github.io/blockly-samples/plugins/field-grid-dropdown/test/index.html
  2. Using the console, add a simple event listener to log block selection events. For example:
Blockly.getMainWorkspace().addChangeListener(e=>{if(e.type===Blockly.Events.SELECTED){console.log(e);}})
  1. Drag a block out of the toolbox and connect it to another block.
  2. Inspect the console. You will see over a dozen selection events.

This does not happen with v11, such as at https://blockly-demo.appspot.com/static/tests/playground.html

Stack trace

Screenshots

Image

Browsers

No response

Activity

  1. removed
    status: triageIssues awaiting triage by a Blockly team member
    on May 23, 2025
  2. BenHenning commented on May 27, 2025

    @BenHenning
    Contributor

    More selected events is definitely expected due to us now being a bit eager with firing selected events on each block focus/blur. This should be remediated slightly with #9082 (which isn't available yet) since I noticed that we were actually calling the lifecycle blur/focus callbacks multiple times for each focus. I think that means that selected events are roughly 6x more often than they were before, and after that PR will being 2x more often.

    We would need to introduce some additional logic in order to get back to parity with v11. I'll be keen to see if #9082 is sufficient for the performance fix, or if we do need to do that additional logic.

  3. rachel-fenichel commented on Nov 21, 2025

    @rachel-fenichel
    Collaborator

    @BenHenning and @mikeharv were the fixes from $9082 sufficient to close this issue?

  4. added theissue type on Jul 8, 2026
  5. self-assigned this
    on Jul 10, 2026
  6. moved this from Todo to In Progress in Blocklyon Jul 10, 2026
  7. moved this from In Progress to Done in Blocklyon Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions