Issue #2207Opened August 20, 2019by niisar0 reactions

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

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, 20190 reactions

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, 20190 reactions

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, 20190 reactions

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

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.