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

[Feature]: v6 API to Change a activeSelection to a normal group #9854

Open
4 tasks done
ouyoungs opened this issue May 6, 2024 · 1 comment
Open
4 tasks done

[Feature]: v6 API to Change a activeSelection to a normal group #9854

ouyoungs opened this issue May 6, 2024 · 1 comment
Labels

Comments

@ouyoungs
Copy link

ouyoungs commented May 6, 2024

CheckList

  • I agree to follow this project's Code of Conduct
  • I have read and followed the Contributing Guide
  • I have searched and referenced existing issues, feature requests and discussions
  • I am filing a FEATURE request.

Description

since v6 changes: #7670
this dosen't work now:
http://fabricjs.com/manage-selection

is there any API to Change a activeSelection to a normal group? thx everyone!

Current State

Version

6.0.0-rc1

this dosn't work:

const objects = canvas.getActiveObjects()
canvas.discardActiveObject();
if (objects) {

	canvas.remove(...objects);
	const group = new Group();
	objects.forEach((obj) => {
		group.add(obj)
	})

	canvas.add(group);
	canvas.renderAll();
}

Additional Context

No response

@asturur asturur added the bug label Jun 23, 2024
@gloriousjob
Copy link
Contributor

Does the current state code still not work? A rudimentary test seems fine and probably could be used to fix the demo (I would just do "new Group(objects)" instead of separating the forEach).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants