How to load children of a readonly component?
hi there! you can set draggable property of the target component this way: this way, it will only be draggable inside the Slot. the same can be done for readonly type. if you need further help for your specific case, i would appreciate a fiddle. cheers.
Read full answer below ↓Question
I'm trying to mount a readonly component (draggable, droppable etc all set to false) and allow the user to edit child components inside.
For example if I have the following content
<div class="wrapper">
<header>A header</header>
<div>
EDIT ME
</div>
<footer>A footer</footer>
</div>
I want to load all of this content inside of the component, and allow the user to drag new blocks where it would say "EDIT ME"
Answers (3)
hi there! you can set draggable property of the target component this way: this way, it will only be draggable inside the Slot. the same can be done for readonly type. if you need further help for your specific case, i would appreciate a fiddle. cheers.
Hi there! if you mean injecting the component into the editor without user interactions, you can use: more on this hereallow the user to drag new blocks where it would say "EDIT ME" if you mean making the readonly component editable again, it is achievable this way: more on this here cheers!
@pouyamiralayi Thanks! I've implemented a Slot component and overriding the attributes inside of the init method The issue I'm having now is that the use is able to drag an item above the readonly header for example. Is there a way to prevent this behaviour? I want to prevent items being dropped be...
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1912
[QUESTION] Custom component default children
Hi, I am trying to understand how I can achieve the following.Create a component with a default content as children.Create a block to add t...
Issue #4752
Component with pointer-events: 'all' (except wrapper) or editable component are draggable & droppable to itself.
GrapesJS version[X] I confirm to use the latest version of GrapesJSWhat browser are you using? Chrome 107.0.5304.121 (Official Build) (arm6...
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 #2195
[Question] Define components in template
QuestionsHow can I make a part of my template a component ?How can I set draggableComponents on such a component?If so, then can I stop set...
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 →Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.