Style manager text type
@aliibrahim123 if you don't specify any type, a simple text type property will be created :)
Read full answer below ↓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 (3)
@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() {
}
});Thanks for reporting this, @aliibrahim123.
Great suggestion about FEAT: style manager text type! While this specific feature isn't yet in the core API, there are several ways to achieve similar behavior.
Using the event system:
editor.on('component:update', (component) => {
// your logic here
});
Alternative approaches:
- Listen to
selector:addfor CSS selector changes - Use
selector:customfor custom rules - Tap into the
change:*events for fine-grained tracking - Build a plugin that extends the editor with this capability
Making it official: If this feature would benefit many users, consider opening a formal Feature Request on the GrapesJS repo with:
- A detailed use case
- Code example showing the desired behavior
- Why this matters for your workflow
The core team is receptive to well-motivated feature requests backed by real use cases.
Related Questions and Answers
Continue research with similar issue discussions.
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 #3561
FEAT: Enhanced Shadow DOM Support
What are you trying to add to GrapesJS? Better Shadow DOM support, allowing developers to render GrapesJS inside a Shadow element without h...
Issue #3486
FEAT: Ability to change all margin, padding etc properties together
Hello, right now grapesjs provides built in properties like margin, padding that allow user to change each property one by one (margin-top,...
Issue #3206
FEAT: Page Manager Plugin
Feature: The ability to create multiple pages in Grapesjs. Functional design Globally:[ ] Include a link to the right of 'Device [dropdown...
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.