Drag placeholder for rendered elements
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)
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...
Unfortunately, moving components is slightly different so I'm still working on this
Actually, I was thinking about adding such a functionality but didn't go so far ๐ฌ https://github.com/artf/grapesjs/blob/dev/src/commands/view/MoveComponent.js#L74
Related Questions and Answers
Continue research with similar issue discussions.
Issue #3512
Child elements not draggable ,droppable highlightable. also the CSS of all child elements not pushed in style section while develop a banner component in as plugin
Hello @artf , I am trying to develop a simple banner plugin which will be include a heading , subheading and link. and every element can be...
Issue #2961
Components in custom modal isn't editable
Hello, I'm trying to add custom modal block to my project and I want to change content of this modal also with drag&drop. Here's code of my...
Issue #2595
Having trouble dragging external html with draggable="true"
I want to make an external html element able to be dragged into GrapesJS, like how you can drag in a block and it will add something. I hav...
Issue #710
Make an entire element draggable, not just the handle
I'm working on modifying the handle from draggable elements, in addition to having a handle, I'd like the entire element to be draggable. L...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins โ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.
Tutorial
Vanilla GrapesJS vs GrapesJS With Plugins: What You Actually Get Out of the Box (2026)
New to GrapesJS? See exactly what the stock editor gives you, where it falls short, and which plugins close the gaps โ a beginner-friendly 2026 comparison
Tutorial
How We Built Composeit in Record Time Using GrapesJS Shadcn
Bypass foundational builder boilerplate and focus on what truly matters.
Tutorial
How to integrate GrapesJS into an Astro app (complete guide 2026)
Embed GrapesJS in an Astro site: mount it in a client-side script, save content to an Astro API endpoint, and export clean HTML/CSS.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.