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

Removing of multiple objects with preserved object stacking #4109

Closed
dkirchhof opened this issue Jul 19, 2017 · 3 comments
Closed

Removing of multiple objects with preserved object stacking #4109

dkirchhof opened this issue Jul 19, 2017 · 3 comments
Labels

Comments

@dkirchhof
Copy link

Hello,
i want to delete all currently selected objects at once. Since i set the property preserveObjectStacking to true, it throws an error and deletes just one of the selected objects.
One workaround is to set the flag to false before deleting and set to true again when finished (line 14 & line 19 in the fiddle).

Version

1.7.16

Test Case

https://jsfiddle.net/ak68wm19/1/

Steps to reproduce

  1. Open fiddle
  2. Select more than one object
  3. Press delete

Expected Behavior

All objects should be deleted.

Actual Behavior

Following error will be thrown:

Uncaught TypeError: Cannot read property 'getActiveGroup' of undefined
    at i._renderControls (VM139 fabric.min.js:4)
    at i._renderControls (VM139 fabric.min.js:6)
    at i._renderControls (VM139 fabric.min.js:1)
    at i.drawControls (VM139 fabric.min.js:4)
    at i.renderCanvas (VM139 fabric.min.js:3)
    at i.renderAll (VM139 fabric.min.js:3)
    at i.remove (VM139 fabric.min.js:1)
    at i.remove (VM139 fabric.min.js:4)
    at selection.forEach.obj (VM138:61)
    at Array.forEach (<anonymous>)
@asturur
Copy link
Member

asturur commented Jul 19, 2017

i think that removing the objects of the activeGroup trigger some sort of deselection process.
Worth a check.

@asturur
Copy link
Member

asturur commented Jul 22, 2017

https://jsfiddle.net/ak68wm19/2/

this can be fixed deleting first the activeGroup and then the objects.
I m working on a fix anyway.

@asturur
Copy link
Member

asturur commented Jul 22, 2017

closed with #4120

@asturur asturur closed this as completed Jul 22, 2017
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

2 participants