Prevent modifying specific image components
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)
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...
Thanks @artf! Here's the pull request: https://github.com/artf/grapesjs/pull/496
Merged https://github.com/artf/grapesjs/pull/496 π
Related Questions and Answers
Continue research with similar issue discussions.
Issue #710
Make an entire element draggable, not just the handle
I'm working on modifying the handle from draggable elements, in addition to having a handle, I'd like the entire element to be draggable. L...
Issue #1179
[Question] Cannot load styles saved as !important
Hi! I'm trying to make all the user-set styles have the "!important" flag, in order to prevent some other previous existent classes to over...
Issue #362
How to create custom link components that prompts users to type link/choose link similar to Images Component Modal
Image Components have logic to call Modal and prompt user's interaction for options/configuration of image url. Would like to do similar to...
Issue #554
Prevent hover highlighter and prevent selecting certain components
Hi @artf, I would like to get your thoughts on the following 2 items before submitting a pull request. These are to satisfy requirements fo...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins β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.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.