FEAT: style manager text type
Question
grapesjs style manager has so many nice features, but it does not have a text property type, so why do not add it
Answers (2)
@aliibrahim123 if you don't specify any type, a simple text type property will be created :)
hallo
i made a simple text proporty type
this is the code
styleManager.addType('text', {
create({ props, change }) {
const el = document.createElement('div');
el.innerHTML = '<input type="text" class="my-input" />';
const inputEl = el.querySelector('.my-input');
inputEl.addEventListener('change', event => change({ event })); // change will trigger the emit
inputEl.addEventListener('input', event => change({ event, complete: false }));
return el;
},
emit({ props, updateStyle }, { event, complete }) {
const { value } = event.target;
const valueRes = value;
updateStyle(valueRes, { complete });
},
update({ value, el }) {
el.querySelector('.my-input').value = value;
},
destroy() {
}
});Related Questions and Answers
Continue research with similar issue discussions.
Issue #3294
FEAT: Adding options to properties list array in style manager
Hi, How can I add buildProps to properties list such that when an option is selected, the properties of that option will be displayed An ex...
Issue #3067
FEAT: remove 'display: block' inline style from Style Manager sectors and properties
What are you trying to add to GrapesJS? Improve visibility for Style Manager sectors and properties. Describe your feature request detailed...
Issue #3525
FEAT: In Style Manager, Allow Requiring the Default Setting
What are you trying to add to GrapesJS? The CSS property float only makes sense for position: static; elements, which happens to be the def...
Issue #3040
FEAT: Mouse over text on Style Manger items
What are you trying to add to GrapesJS? Hi. Not sure if this is already baked in but: Is it possible to change the mouse over text on a cus...
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.