Skip to content

Deleting a top-level selected block scrolls the workspace to the top left #9585

@riknoll

Description

@riknoll

Check for duplicates

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

Description

When you delete the selected block and there is no containing parent block for the focus manager to select (ie the block is top-level), the manager defaults to focusing whatever block is in the top-left of the workspace which scrolls the workspace to top left.

This behavior is very annoying for large workspaces because it means constantly having to re-scroll to wherever you are in your project whenever you delete something. For example, if you want to delete three blocks that are top level in the bottom right of your workspace, you're going to have to scroll all the way from the top left to the bottom right three times.

The expected behavior imo would be to focus whatever node is closest to the block's original location before being dragged/deleted.

Reproduction steps

  1. Open the Blockly playground
  2. Place a block in the top-left of the workspace and scroll to the right so that the block is no longer visible
  3. Place a few other blocks on the workspace
  4. Delete one of these blocks
  5. Watch as the workspace is scrolled away from where you were working

See screenshots below for a recording of me reproducing this issue

Priority

This is primarily an issue for our MakeCode Arcade editor, where large blocks projects are very common. I expect this will affect most of our users, so we consider this a high priority issue.

I haven't worked in the focus manager code before, so I can't speak to the effort involved but the solution at least seems clear.

Stack trace

Screenshots

Image

Browsers

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue: bugDescribes why the code or behaviour is wrongissue: triageIssues awaiting triage by a Blockly team member

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions