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

Add an option allowing to select and drag multiple blocks at the same time #4739

Closed
HollowMan6 opened this issue Mar 28, 2021 · 1 comment
Closed
Labels
issue: feature request Describes a new feature and why it should be added wontfix

Comments

@HollowMan6
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Can blockly add an option that allows to select and drag multiple blocks at the same time? Now it's frustrating to only drag and drop the blocks one by one when I want to move a batch of blocks from one place to another to make it looks tidy, or when I want to delete them in batch.

Describe the solution you'd like

Add an option to select and drag multiple blocks. When users press Shift key for example, users are allowed to select multiple blocks by clicking them. Then when the key is released, users can drag and move them. This is pretty much alike of selecting and dragging files on OS like Windows, Mac, etc.

Describe alternatives you've considered

I've tried using DragSelect to select multiple blocks in blockly: https://github.com/ThibaultJanBeyer/DragSelect

<script src="https://dragselect.com/v2/ds.min.js"></script>
s = new DragSelect({ 
  selectedClass: "blocklySelected",
  selectables: document.querySelectorAll("g.blocklyBlockCanvas > g.blocklyDraggable"),
  area: document.querySelector('.blocklyWorkspace'),
  multiSelectMode: true,
  draggability: false
});

But I can't drag the selections after selecting. Everytime I do this, only one block is dragged instead of a batch. I guess it's because of the event listener conflict.

So making that library work in blockly is also a feasible solution.

Additional context

Not applicable.

@HollowMan6 HollowMan6 added issue: triage Issues awaiting triage by a Blockly team member issue: feature request Describes a new feature and why it should be added labels Mar 28, 2021
@rachel-fenichel
Copy link
Collaborator

This is best built as a plugin, and we have an issue for that on our other repository: google/blockly-samples#267

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: feature request Describes a new feature and why it should be added wontfix
Projects
None yet
Development

No branches or pull requests

3 participants