[Question] - How we can hide RTE for editable components ?
Question
HI We have a requirement, where we don't want to show rte on editable components. how we can achieve that ?
Answers (3)
I allow myself to add what I think might be closer to what OP's trying to achieve, from @artf's answer:
editor.DomComponents.addType('text', {
extendFnView: ['onActive'],
model: {
defaults: {
disableRte: false
}
},
view: {
onActive() {
if (this.model.get('disableRte')) {
this.rte.getToolbarEl().style.display = 'none';
}
}
}
}
Toggling the disableRte property allows to hide the RTE toolbar, while keeping the text editable, on a per-component basis.
Hope this helps :)
editor.on('component:selected', cmp => {
cmp.set({
editable: false,
propagate: ['editable']
})
})
We don't want to make component non editable, component needs to be editable, we just don't want to show rte tool bar on that component.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #697
Question: Dropping external element into blocks
Hello, I want to drop external elements ( for example, tree view node) into blocks. Can you please help me out to show a way, how to achiev...
Issue #2742
[QUESTION] How to prevent unique ids generation?
Hi! Thanks for your work @artf. This is a simplified code of how I use grapesjs, I want to save the styles and then want to apply them agai...
Issue #2188
[QUESTION] How to change tagName using traits.
Hello, I want to achieve this: When user clicks on a heading tag H1, H2, H3 ... I want a trait to appear (of a select / dropdown type) whic...
Issue #2170
[QUESTION] Custom component - how to set editable to true
Hi, I've created a custom component type, but I am having some trouble making it editable. The component is a "span" with component type "t...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.