react-design-editor icon indicating copy to clipboard operation
react-design-editor copied to clipboard

[Bug] Group add function needs to be fixed

Open fran1990Web opened this issue 4 years ago • 4 comments

hI! Does anyone know how to fix this bug? File handler.ts. When you create a group and you export the json. If you load the json, that group works bad if you ungroup the group :) I debug the code and i can see this:

  • First the line: const objects = this.addGroup(newOption, centered, loaded); creates elements in canvas. Imagine, you create two elements text
  • The line const groupOption = Object.assign({}, newOption, { objects, name: 'New Group' }); generates the object group
  • The line createdObj = this.fabricObjects[obj.type].create(groupOption); creates a group but when you add this group on canvas, canvas has three elements and not one. two text and a group, it must be only one, a group with 2 elements inside.

The editor is amazing, thank you very much for the work. If someone knows something with this, I ll appreciate it help

Example case: lorem

fran1990Web avatar Feb 22 '21 14:02 fran1990Web

@fran1990Web

Hi.

I think I know what kind of bug it is.

I'll fix it.

Thanks.

salgum1114 avatar Mar 02 '21 02:03 salgum1114

Thanks! :)

fran1990Web avatar Mar 03 '21 16:03 fran1990Web

Hi @salgum1114 ,

I'm also facing a similar issue. Any update/hint for this?

akshaybosamiya avatar May 25 '21 13:05 akshaybosamiya

I created a pullrequest for this... #217

AndreasBurbach avatar Aug 02 '21 09:08 AndreasBurbach