Grapesjs: how to make sure block is dropped only at the top level

Created on 3 Apr 2018  路  3Comments  路  Source: artf/grapesjs

For example I have two blocks A and B that I want to drop to the editor canvas. But sometimes the block that dropped later become the child of existing block. That is A>B layout. But I want to force the blocks can only be the sibling level.eg. A+B
How can I do that? Maybe component:add event?

outdated

Most helpful comment

@anand-gopinath cool~ work like a charm. Now I found many data attributes usage....
It is a very good framework but the doc is lag behind...

All 3 comments

@crazyxhz : You can do it by adding data attributes to the content "data-gjs-droppable='.className'", For ex https://jsfiddle.net/wswvuvab/2/

@anand-gopinath cool~ work like a charm. Now I found many data attributes usage....
It is a very good framework but the doc is lag behind...

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

FlashPapa picture FlashPapa  路  3Comments

YashPrince picture YashPrince  路  3Comments

faizansaiyed picture faizansaiyed  路  3Comments

kawika-connell picture kawika-connell  路  3Comments

Snarkly picture Snarkly  路  3Comments