Issue #705💬 AnsweredOpened January 4, 2018by austinbiggs2 reactions

Drag placeholder for rendered elements

Quick answerby artf1

Probably the reason of why I gave up 😂 As you see from here https://github.com/artf/grapesjs/blob/dev/src/commands/view/MoveComponent.js#L74 I tried using setDragHelper which copies the element's style from getComputedStyle but I also remove its children dragHelper.innerHTML = '' as getting inners style could be too...

Read full answer below ↓

Question

Hello! I'm digging through code and I'm trying to achieve a placeholder effect while dragging the element? Something similar already exists for dragging blocks. If I want to add something to achieve this, what method would I need to modify/hook into? I don't see a startDrag option for elements on the canvas. similar to: http://gridstackjs.com/

Answers (3)

artfJanuary 4, 2018

Probably the reason of why I gave up 😂 As you see from here https://github.com/artf/grapesjs/blob/dev/src/commands/view/MoveComponent.js#L74 I tried using setDragHelper which copies the element's style from getComputedStyle but I also remove its children dragHelper.innerHTML = '' as getting inners...

artfJanuary 20, 2018

Unfortunately, moving components is slightly different so I'm still working on this

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.