Ignore/avoid changeCount
Hi @santiph well, if the problem is onbeforeunload you can disable it with noticeOnUnload
Read full answer below ↓Question
Due to https://github.com/artf/grapesjs/issues/436, I cannot rely on StorageManager's Remote Load method to load a template from a REST endpoint, so I'm falling back to alternatives as editor.setComponents() and editor.setStyle() (being used within a command, so grapesjs and editor are available). Unfortunately, those methods make changesCount to increase and triggers onbeforeunload event when our users try to leave the webpage. Also, including sentences like editor.editor.set('changesCount', 0); in the command are useless, since changesCount gets incremented as soon as the command finishes (...
Answers (3)
Hi @santiph well, if the problem is onbeforeunload you can disable it with noticeOnUnload
grapesjs.init({
...
noticeOnUnload: false
})
Hi @artf I need to warn the user know of any unsaved changes consistently. And skip it when there's nothing new to be saved: When a new empty template is created, right after saving or right after loading a template, no confirmation message should be displayed. Saving scenario through StorageManage...
I could test it with remote storage fully: onbeforeunload is disabled, as expected, on closing right after saving. Unfortunately, it's still being displayed on closing right after loading a new template. After a little debugging, loading a new template seems to increase changesCount to 1. (Load cha...
Related Questions and Answers
Continue research with similar issue discussions.
Issue #768
IE browser issue
Hi @artf , Created this issue due to https://github.com/artf/grapesjs/issues/214 has been closed ... I cloned the latest repo and run it on...
Issue #1908
[question] Cannot read property 'indexOf' of undefined
I found a previous result here: https://github.com/artf/grapesjs/issues/1772 however I can still not get it to work, using the most basic s...
Issue #901
Can we have local and remote storage at the same time.
WARNING READ and FOLLOW next 5 steps, then REMOVE them before posting the issueFollow CONTRIBUTING Guidelines https://github.com/artf/grape...
Issue #1757
Remote storagemanager not working
Hello, For 2 days I am fighting with the storageManager. I couldn't load template from remote file. Finaly I discovered that it is working...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins →Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.
Browse premium plugins →Related tutorials
In-depth guides on the same topic.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.