Skip to content

Minimap affecting focus #10429

Open

Description

@QuirkyCort

Check for duplicates

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

Component

Minimap plugin

Description

When editing a text field within a block, pressing tab will sometimes fail to move focus to the next text field.

Reproduction steps

  1. Open the minimap test page here https://raspberrypifoundation.github.io/blockly-samples/plugins/workspace-minimap/test/index.html
  2. Drag in a "count with i from" block
  3. Click on the first number "1" and change that to "2".
  4. Press tab.

The focus should shift to the second number "10", but instead, the "10" briefly flashes and focus is lost.

Stack trace

Screenshots

No response

Activity

  1. added
    help wantedExternal contributions actively solicited
    and removed
    status: triageIssues awaiting triage by a Blockly team member
    on Dec 5, 2025
  2. added theissue type on Jul 8, 2026
  3. moved this from Todo to In Progress in Blocklyon Sep 11, 2026
  4. ritfiz commented on Oct 24, 2026

    @ritfiz
    Contributor

    @maribethb @lizschwab , I looked into this. The minimap triggers it, but the root cause is a bug in core.

    TLDR;

    Root cause

    Its this part of the code in WidgetDiv.ts in function hideIfOwnerIsInWorkspace

    on line 262: let currentWorkspace = workspace;
    and then on 264: if (currentWorkspace === workspace) { which will always evaluate to true. :)

    FIx

    We should set the let currentWorkspace = ownerWorkspace;
    and walk up the tree to parents currentWorkspace = currentWorkspace.options.parentWorkspace;

    Long Explanation follows

    Everytime a text editor is opened on a workspace, it lives in a shared container (WidgetDiv).
    whenever we edit a number in a block and press tab and if the minimap is open - it tries to replicate this change
    it does a zoomTofit() -> hideChaff() to close any open widgets etc.
    The problem is, it inadvertently closes the main workspace widget. We should correctly check the ownership before closing, this ownership check is broken currently.

    If my explanation seems reasonable, can I open a PR for this ?

  5. lizschwab commented on Oct 26, 2026

    @lizschwab
    Contributor

    Hi Rituraj,

    You're always welcome to open a PR against Blockly, so please feel free to do so. I haven't looked too deeply into the code, but I don't see any immediate issues with your approach.

  6. ritfiz commented on Oct 26, 2026

    @ritfiz
    Contributor

    Thank you. I have opened a PR (#10633) for the same and added tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    • Status
      In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions