BUG: Component with pointer-events: 'all' (except wrapper) or editable component are draggable & droppable to itself.
Question
GrapesJS version
- I confirm to use the latest version of GrapesJS
What browser are you using?
Chrome 107.0.5304.121 (Official Build) (arm64)
Reproducible demo link
https://jsfiddle.net/artur_arseniev/aku70f5w
Describe the bug
How to reproduce the bug?
- Try to drag and drop the editable component or component having a
pointer-events: allCSS in itself. It will disappear. As this operation performs an infinite loop and returns an error on the consoleUncaught RangeError: Maximum call stack size exceeded. Even after setting draggable false to the editable component, it is draggable.
What is the expected behavior? The editable component should not be draggable to itself same as the wrapper component.
What is the current behavior? The editable component is draggable to itself. Even after setting it as draggable false.

Code of Conduct
- I agree to follow this project's Code of Conduct
Answers (2)
There was an issue with the demo itself which now it's fixed (added draggable: false to the wrapper component)
Patch for getCss to return always the content from the editable component is not working, can you please help me to solve this @artf The below code (present in the reproducible demo link) always returns the whole canvas or wrapper CSS string.
editor.getModel().getCss = () => {
const wrapper = editor.getWrapper();
const cmp = wrapper.findType('editable')[0];
return cmp ? editor.CodeManager.getCode(cmp, 'css') : '';
};
Related Questions and Answers
Continue research with similar issue discussions.
Issue #4323
BUG: Performance issue while dragging component to canvas when you have 2k component on canvas
GrapesJS version[X] I confirm to use the latest version of GrapesJSWhat browser are you using? Google Chrome Version 101.0.4951.41 (Officia...
Issue #5718
BUG: Possible upgrade path issue where 'textnode' is now called 'wrapper' from 0.18 -> latest
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome Version 122.0.6261.95 (Official Bui...
Issue #5689
BUG: <> is introduced at the beginning editor.getHtml()
GrapesJS version[X] I confirm to use the latest version of GrapesJSWhat browser are you using? Chrome Version 121.0.6167.185 (Official Buil...
Issue #4136
BUG: component.remove() in 'component:mount' does not remove the rendered view
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome Version 98.0.4758.80 (Official Buil...
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.