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

[Bug]: After setting lockMovementX and lockMovementY on the object, single selection is normal, but multiple selections can be moved #10245

Open
7 tasks done
zhuyue6 opened this issue Nov 1, 2024 · 2 comments

Comments

@zhuyue6
Copy link

zhuyue6 commented Nov 1, 2024

CheckList

  • I agree to follow this project's Code of Conduct
  • I have read and followed the Contributing Guide
  • I have read and followed the Issue Tracker Guide
  • I have searched and referenced existing issues and discussions
  • I am filing a BUG report.
  • I have managed to reproduce the bug after upgrading to the latest version
  • I have created an accurate and minimal reproduction

Version

5.3.0

In What environments are you experiencing the problem?

Chrome

Node Version (if applicable)

None

Link To Reproduction

https://codesandbox.io/p/devbox/fabric-vanillajs-sandbox-forked-v7yt9f

Steps To Reproduce

  1. select two objects
  2. move objects

Expected Behavior

After multiple selections, you can’t move it

Actual Behavior

After multiple selections, you can move it

Error Message & Stack Trace

No response

@gloriousjob
Copy link
Contributor

I'm not sure if the expected behavior is as intuitive as it sounds. Should a multiselect not be movable if one item is locked but another isn't or should it be movable because one item isn't?

You could try adding this to enforce multiselects can't move:
fabric.ActiveSelection.ownDefaults = {
...fabric.ActiveSelection.ownDefaults,
lockMovementX: true,
lockMovementY: true
};

@zhe-he
Copy link
Contributor

zhe-he commented Nov 27, 2024

I think he wants to achieve this effect, and I want to achieve it too.

2024-11-27.11.18.40.mov

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

No branches or pull requests

3 participants