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

Can't move selected shapes in front of a locked shape by dragging within their bounds #2316

Closed
Taha-Hassan-Git opened this issue Dec 12, 2023 · 0 comments · Fixed by #2337
Closed

Comments

@Taha-Hassan-Git
Copy link
Contributor

When you have some selected shapes that are in front of a locked shape... You should be able to drag those shapes by clicking+dragging anywhere in their bounds. But when you do this, it deselects them instead.

A locked shape should behave the same way as if you pointer down on the canvas. The only difference should be when you right-click. (Or long press).

Repro:

  1. Make a big locked shape (eg: large filled-in rectangle).
  2. Put some smaller shapes on top of it (eg: some smaller rectangles).
  3. Select the small shapes.
  4. Try to move the small shapes by clicking and dragging somewhere in their bounds. But not directly on any of the shapes themselves.

Expected: The small shapes move.
Actual: The small shapes get deselected.

Image

github-merge-queue bot pushed a commit that referenced this issue Dec 19, 2023
This PR allows dragging a selection on top of a locked shape. This
should work when clicking inside of the selection, but not directly on a
shape.

Before:


https://github.com/tldraw/tldraw/assets/2523721/53583ae9-9ed7-455e-bdc4-ba13804dd8a3

After:


https://github.com/tldraw/tldraw/assets/2523721/81d8f8bf-5474-4a09-abac-75059a089851



Fixes #2316
Fixes #2315

### Change Type

- [x] `patch` — Bug fix
- [ ] `minor` — New feature
- [ ] `major` — Breaking change
- [ ] `dependencies` — Changes to package dependencies[^1]
- [ ] `documentation` — Changes to the documentation only[^2]
- [ ] `tests` — Changes to any test code only[^2]
- [ ] `internal` — Any other changes that don't affect the published
package[^2]
- [ ] I don't know

[^1]: publishes a `patch` release, for devDependencies use `internal`
[^2]: will not publish a new version

### Test Plan

1. Create a big shape and lock it.
2. Create two shapes on top of the locked shape and select them.
3. Start dragging the selected shapes by clicking inside the selection
(but not directly on any of the shapes). This should allow you to
translate the selection.
4. Should also work if the shapes are behind the locked shape.

- [x] Unit Tests
- [ ] End to end tests

### Release Notes

- Allow translating of shapes on top of a locked shape by clicking
inside of selection and moving the mouse.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant