How to prevent drag items inside the editor
Question
Hello @artf You are doing great job with grapesjs and it's extremely helpful to make our functionality more user friendly. Thanks for creating such a amazing open source lib.
I want to know that suppose i want to prevent drag of all html content like div, ul, li, etc then how can i?
I guess i just need to add some configuration when i initialise grapesjs.init({ .... }).
Actually i am providing default html content as a default template and on that default template/layout user can edit and launch his own website. So, i have one page in my template and i want to prevent like user can't change layout but user can add new component.
I also tried with nativeDnD option but looks like not working for me.
Can you please help me for how can i fix this functionality?
Answers (3)
Start from reading this: https://grapesjs.com/docs/modules/Components.html then check all the available properties on Components: https://grapesjs.com/docs/api/component.html
Hello @artf
I have one div which class is like testing and i want to restrict the child items of this div with class testing then how can i do this?
Can anyone guys help me to figure it out? Thanks in advance.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1780
How to change extra dropdown for link change trait
Hello @artf , I want to give one more functionality to user like user can change any link with default links drop down. In above image i wa...
Issue #1111
How to add parent class when drag element
Hi @artf, Hope you are doing fine. Please let us know how we can add the parent class of div when new element is dragged inside that div li...
Issue #1120
Check empty element
Hi @artf, Hope you are doing fine, I want to check when section element is empty like i drag a empty section and then inside that i drag h1...
Issue #1754
[Bug] problem of styling with ckeditor(4)
Hello @artf and all ! Thanks again for the amazing job ! I tried to implement ckeditor with grapesjs and it seems to work pretty much corre...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.