Issue #1325Opened July 30, 2018by ploutos271 reactions

How to disable drop for specific blocks/components

Question

Hello,

with the following code we are able to indicate if it's possible to drop other component(blocks) inside that particular component...:

/* Component */
    blockManager.add('component', {
        label: '<div class="gjs-block-label">COMPONENT</div>',
        attributes: { class: 'gjs-fonts gjs-f-b3' },
        content: {
            name: 'Component',
            classes: ['component'],
            type: 'component',
            droppable: false,
            components: `This is the component`
        }
    }); 

We are looking to indicate if it's possible to drop other components only for specific blocks.

For example:

A. Container Block - > we want to drop only columns B. Column Block - > we want to drop only columns and components

We thought that we could do that by using an array of selectors which could be dropped inside (as documentation says) but unfortunately is not working:

    /*Column*/
    blockManager.add('column', {
        label: '<div class="gjs-block-label">COLUMN</div>',
        attributes: { class: 'gjs-fonts gjs-f-b1' },
        content: {
            name: 'Column',
            classes: ['column'],
            type: 'column',
            droppable: ['column', 'component'],
            components: ``,
        }
    });

Any ideas? Thank you!

Answers (3)

ploutos27August 2, 20180 reactions

Thank you! :)

lock[bot]September 17, 20190 reactions

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.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.