Restrict draggable elements to parent?
I'm not sure if this already exists and I haven't seen it yet (apologies if that's the case). Is there a way to restrict where certain draggable elements are droppable?
Say I have a list:
<ul>
<li>one</li>
<li>two</li>
<li>three</li>
</ul>
And I want the user to be able to rearrange the list items, but restrict them from dragging outside of the <ul>.
similar to http://api.jqueryui.com/draggable/#option-containment
Sure, you can make use of data-gjs-* attributes (eg. data-gjs-draggable="ul")
Check the last example code here https://github.com/artf/grapesjs/wiki/Blocks
It seems you've thought of everything, you've done such an amazing job w/ GrapesJS! 😄
Thanks Austin :)
Sure, you can make use of
data-gjs-*attributes (eg.data-gjs-draggable="ul") Check the last example code here https://github.com/artf/grapesjs/wiki/Blocks
Is it possible to specify a div class name or id in case i have a lot of nested divs?
@sakshigarg9 you can use any query selector (eg. div#some-id > .class)
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.