Issue #744💬 AnsweredOpened January 11, 2018by michaellwatson0 reactions

Make outer element unselectable

快速解答by artf

https://jsfiddle.net/wswvuvab/2/ Seems to work properly (check your version), I added data-gjs-hoverable="false" property to prevent the highlighting box

Read full answer below ↓

Question

I'm trying to make the outer element not selectable, and the inner one selectable only

 editor.BlockManager.add('full-width',
    {
        category:'Sections', 
        label: 'Full Width',
        content: '<section class="row" data-gjs-droppable=".col" data-gjs-custom-name="Row" data-gjs-selectable="false" data-gjs-selectable="false">\n <div class="col col-lg-12 col-md-12 col-sm-12 col-xs-12 text-center" data-gjs-draggable=".row" data-gjs-custom-name="Col"></div>\n</section>',
    });

Outer element is the section tag and the inner one is the div, I need the section to be there for reasons, but I don't want it to be selectable

The data-gjs-selectable=false tag doesn't seem to be working for me, as the outer element is still selectable, I'd be grateful if anyone knew the correct syntax to achieve this, thanks

Answers (3)

artfJanuary 11, 2018

https://jsfiddle.net/wswvuvab/2/ Seems to work properly (check your version), I added data-gjs-hoverable="false" property to prevent the highlighting box

michaellwatsonJanuary 11, 2018

Must be my version then, because its still selectable/hoverable, but it does accept data-gjs-highlightable="false", thanks for your help again

lock[bot]September 18, 2019

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...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Related tutorials

In-depth guides on the same topic.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.