Grapesjs: [BUG]: Grapes cannot be reinitiated with new HTML

Created on 28 Feb 2018  路  3Comments  路  Source: artf/grapesjs

Calling init() on Grapes after changing HTML fails. This kinda situation happens on one page apps.

I think a destory() function to gracefully reset Grapes is needed.

  1. https://jsfiddle.net/wdtrg1je/ (very bare bones simulation of a one page app)
  2. Click "Add Grapes" (loads Grapes with a some HTML)
  3. Click the "Link", change it's href to http://yahoo.com
  4. Click "Remove Grapes". This grabs the HTML from Grapes before destorying the grapes element.
  5. Click "Add Grapes" again. This starts Grapes again with the new HTML which differs from the original HTML.
  6. Error in console.

screen shot 2018-02-28 at 14 54 20

If "Add Grapes" and "Remove Grapes" are clicked without any changes to HTML, it's fine.

outdated

Most helpful comment

Looks like I'm not the only one who wants this 馃槈 . Single page apps are where this has value (the issue I raise but also freeing up some memory).

I'll look to raise a PR when I got something.

All 3 comments

As already mentioned here, currently, I don't see any value in starting such a feature (creating a good destroy method) but would really happy to see some PR :)

Looks like I'm not the only one who wants this 馃槈 . Single page apps are where this has value (the issue I raise but also freeing up some memory).

I'll look to raise a PR when I got something.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kosirm picture kosirm  路  3Comments

kawika-connell picture kawika-connell  路  3Comments

krunal039 picture krunal039  路  3Comments

ionic666 picture ionic666  路  3Comments

applibs picture applibs  路  3Comments