Closed jdkcoder closed 2 weeks ago
@jdkcoder
By commenting the reRender
function we don't have the issue anymore.
The lastComponent
error comes from the this.get('selected')
in Editor being undefined at some point. And by checking the debugger, it indeed becomes undefined when the reRender is called because it re-initialize grapes.
For the resize, I don't see the issue with the Stackblitz example you gave. You should probably create a separate issue explaining more what's the behaviour you're having and what is expected I think.
You can skip removing the components (instance.value.Components.clear()
) as you're destroying the editor anyway
if (confirm('Are you sure you want to clear the canvas?')) {
localStorage.clear()
reRender()
}
This shouldn't generate any error
GrapesJS version
What browser are you using?
Edge v128
Reproducible demo links
Describe the bug
I'm using GrapesJS in Nuxt.js 3 project, the error
Cannot read properties of undefined (reading 'lastComponent')
shows after everytime I run clearAll() function in /components/common/LeftSidebar.vueAnd here is how I was trying to implement "resize" feature at /stores/editor.store.js for "Text" block but it doesn't work & I don't know why :(