BUG: Create and destroy repeatedly throws error
Question
GrapesJS version
- I confirm to use the latest version of GrapesJS
What browser are you using?
Chrome
Reproducible demo link
https://codepen.io/Harshsne/pen/QwwLjBQ
Describe the bug
How to reproduce the bug?
- Click Create and then Destroy repeatedly and rapidly.
Upon debugging, I found that the error occurs due to the following code:
- undefined 'allcomponents' error is due to : (editor.select code.)
var wrapper = editor.DomComponents.getWrapper();
**editor.select(wrapper);**
- undefined 'lastcomponent' error:
editor.addComponents({
type: 'text',
highlightable: false,
selectable: false,
droppable: false,
draggable: false,
removable: false,
copyable: false,
attributes: { class: 'textbox', "data-placeholder": "Insert your text here" },
content: "fgfghfg",
styles: `.textbox{word-break:break-word;}`,
style: { "height": "110px", "outline": "none !important", "padding": '5px', "color": "grey" }
});
Adding the style to the component triggers the stylable:change event, which throws an error if your side function is still running and you click Destroy during that time.
I attempted to handle this on my side, but the fix didn’t work.
Any suggestions?
Code of Conduct
- I agree to follow this project's Code of Conduct
Answers (0)
No answers yet.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #6549
BUG: Couldnt Resize image
GrapesJS version [x] I confirm to use the latest version of GrapesJS What browser are you using? Chrome Reproducible demo link https://code...
Issue #6485
BUG: showSelectionPalette doesnt work with custom color picker
GrapesJS version [x] I confirm to use the latest version of GrapesJS What browser are you using? Chrome Reproducible demo link https://code...
Issue #6263
BUG: Duplicated links are added using rte
GrapesJS version[X] I confirm to use the latest version of GrapesJSWhat browser are you using? ChromeReproducible demo link https://codepen...
Issue #6374
BUG: Cursor position misplaced
GrapesJS version [x] I confirm to use the latest version of GrapesJS What browser are you using? Chrome Reproducible demo link https://code...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.