Issue #4752Opened November 28, 2022by FaisalShaikhHA0 reactions

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?

  1. Try to drag and drop the editable component or component having a pointer-events: all CSS in itself. It will disappear. As this operation performs an infinite loop and returns an error on the console Uncaught 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.

selfDraggable

Code of Conduct

  • I agree to follow this project's Code of Conduct

Answers (2)

artfDecember 4, 20220 reactions

There was an issue with the demo itself which now it's fixed (added draggable: false to the wrapper component)

FaisalShaikhHADecember 12, 20220 reactions

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.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.