Issue #490πŸ’¬ AnsweredOpened November 8, 2017by ryandeba0 reactions

Prevent modifying specific image components

Quick answerby artf

Yeah, you're right, I use editable only for text components, but what you're asking actually make sense. I'd be happy to accept your PR. You should add editable: true, to the model https://github.com/artf/grapesjs/blob/dev/src/domcomponents/model/ComponentImage.js and then check it in the view here https://github.com/...

Read full answer below ↓

Question

I have a use case where I would like to make some specific components completely locked down (i.e. not resizable, not draggable, not copyable, not removable, etc). I have this mostly working, but I'm having a problem with images - I cannot seem to prevent the double-click functionality that opens the asset manager modal and allows the image source to be changed. Is it possible to prevent that modal from opening when double-clicking an image? I've tried setting the component's "editable" attribute to false component.set({editable: false});, but that does not seem to give the desired behavior....

Answers (3)

artfβ€’ November 8, 2017

Yeah, you're right, I use editable only for text components, but what you're asking actually make sense. I'd be happy to accept your PR. You should add editable: true, to the model https://github.com/artf/grapesjs/blob/dev/src/domcomponents/model/ComponentImage.js and then check it in the view here...

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.