This is immensely helpful. Thank you for responding so quickly and for your fantastic, clever and well designed product which is a massive help to our product.
Read full answer below ↓Question
Hi There
I am trying to implement an editor where certain sections of the page are editable / droppable etc (i.e a mixed page where some elements are dynamic and others aren't). I am having a lot of success by using the data-gjs attributes to block this behaviour generally on the static elements however I don't seem to be able to disable drop on the container element itself? i.e. I am binding my instance to the body element of the page using fromElement: true which has data-gjs-droppable set to false but I am still able to drag blocks anywhere onto the page? Am I missing something here or is this by design?
Thanks a lot
Mark
Answers (3)
This is immensely helpful. Thank you for responding so quickly and for your fantastic, clever and well designed product which is a massive help to our product.
Hi @mrobertshaw the main element is intended as the editor container and not the wrapper. You have to use this option if you need to edit the wrapper's props:
grapesjs.init({
...
domComponents: {
wrapper: { droppable: false, ... }
}
})
Thanks for reporting this, @mrobertshaw.
Great question about ****. The recommended approach with GrapesJS is to use the event-driven API.
Start here:
- Check the GrapesJS documentation for your specific module
- Look for the
on()event listener method - Most operations can be achieved by listening to editor and component events
Common patterns:
// Listen for changes
editor.on('change', () => console.log('something changed'));
// Component lifecycle
editor.on('component:mount', (c) => console.log('component ready', c));
editor.on('component:update', (c) => console.log('component updated', c));
If you're still stuck:
- Share a minimal CodeSandbox reproduction
- Include what you've already tried
- Mention your GrapesJS version
- The community is here to help!
Related Questions and Answers
Continue research with similar issue discussions.
Issue #3249
QUESTION regarding JSON stored by the StorageManager
Hey, @artf. I want to access the json that is generated when a template is stored without actually storing the template. The json object ca...
Issue #3367
Modal template
Is there a way for me to modify the template from a compiled state? https://github.com/artf/grapesjs/blob/d3256e621bb43a537213ffcd86b10dc0b...
Issue #3415
Custom Asset Manager. How to set bg image
Hi there! I'm building a custom modal for the Asset Manager and basically, it seems that I need to override command. How I can understand i...
Issue #3510
Re render traits after certain events (e.g click)
How to re render traits after clicking on buttons ? Note : Re-rendering should not be dom modification. I have created a function that woul...
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
Find the Right GrapesJS Plugin in Seconds: Smarter Discovery Is Live
We're shipping a set of discovery upgrades. New label filters, a proper compatibility switch for GrapesJS vs Studio, one-click and a smarter sort bar.
Tutorial
GrapesJS vs Webflow vs Tilda: What to Choose for Your Business in 2026
Choosing the right website platform in 2026 is no longer just about building a site
Tutorial
GJS Market 2.0 - Donations, Tracking, Labels and Better Product Discovery
We’ve rolled out a new set of GrapesJS marketplace updates across GJS Market, focused on improving how creators distribute products
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.