Issue #2207💬 AnsweredOpened August 20, 2019by niisar0 reactions

Can't drag component if there is some space on top/left with Mode Absolute

Quick answerby pouyamiralayi

this is only for the drag icon, right? the manual dragging is fine. using the drag icon, it resets the position of the element from the top as it seems.

Read full answer below ↓

Question

Given the following code example...

<div style="height: 100px;">
  Some Space on top or left
</div>
<div id="gjs">
  <p style="padding: 25px">
    Hesdllo World!!!</p>
</div>

editor.getModel().set('dmode', 'absolute');

Results in no ability to drag and drop elements to correct position using drag icon on the panel.

image

See Fiddle for demonstration...

https://jsfiddle.net/niisar/zc51gtnv/

Answers (3)

pouyamiralayiAugust 21, 2019

this is only for the drag icon, right? the manual dragging is fine. using the drag icon, it resets the position of the element from the top as it seems.

niisarAugust 22, 2019

this is only for the drag icon, right? the manual dragging is fine. using the drag icon, it resets the position of the element from the top as it seems.

Yes this is only for drag icon.

artfAugust 25, 2019

Yeah the problem here is the different Event object based on the context. When you trigger the drag on the component itself the Event is in the context of the iframe (because the clicked element is in iframe) but component's buttons are outside of the iframe so the context if the Event is the origi...

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...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

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.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.