Gjs-editable='false' works only on drag drog
Question
I have created a component
var comps = editor.DomComponents;
var defaultType = comps.getType('default');
var defaultModel = defaultType.model;
var defaultView = defaultType.view;
comps.addType('module', {
model: defaultModel.extend({
defaults: Object.assign({}, defaultModel.prototype.defaults, {
droppable: false,
editable: false
})
},
{
isComponent: function (el) {
if (el.tagName == 'div' || el.tagName == 'DIV' && (el.attributes.desktopmoduleid != undefined)) {
return { type: 'module' };
}
}
})
});
`editor.BlockManager.add(value.ModuleName, {
category: 'apps',
attributes: { type: 'apps' },
label: '<div><img src="' + value.ModuleImage + '"/><div class="my-label-block">' + value.ModuleName + '</div></div>',
content: '<div desktopmoduleid="' + value.ModuleID + '" mid="" gjs-editable="false" gjs-type="module" gjs-droppable="false" style="padding:10px;">' + value.ModuleName + '</div>'
})`
The gjs-editable="false" works only on drag drop, its not working on page load after saved.Answers (1)
I am able to fix this by creating plugin
Related Questions and Answers
Continue research with similar issue discussions.
Issue #3135
[Help Wanted] How to easily override existing component ?
For example, I want to add a double click event handler on the default video component to open the assets manager. My basic idea was to get...
Issue #3225
How to Update Style from checkbox Trait?
Hi @artf I am trying to update the style using the checkbox trait but it's not calling the function. Here is the code I really appreciate a...
Issue #2549
[QUESTION] Update component view on property change
Hi everyone, I'm trying to create a component that will update it's view based on a property value My approach is bassed on #1227 and on th...
Issue #2839
[Question] I added one component named template in the blocks but when i try to drag another components inside this template component ,it will be dragged but after saving it removes all the components inside it. How to avoid this?
This is code of template component: I debugged it, so i got that : setComponents method in the dom_components clearing it ...but not gettin...
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 →Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.