Update property Input value from model style.
For now, use this editor.trigger('component:toggled') maybe one day I'll make it update automatically
Read full answer below ↓Question
@artf I want to update height of the element and want to give a custom height using following code
var model = editor.getSelected();
var style=model.getStyle();
style['height'] = '600px';
model.setStyle(style);

It's working fine and it's update the selected model style but it does not update the property input value. How can we update the input values also while updating the style.
Any help would be appreciated, thanks in advance.
Answers (3)
For now, use this editor.trigger('component:toggled') maybe one day I'll make it update automatically
@artf I have used
var model = editor.getSelected();
var style=model.getStyle();
style['height'] = '500px';
model.setStyle(style);
editor.trigger('component:toggled')
but it did not updated the value of height field in left panel.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1315
Get all the style value by ID
@artf I want to get all the style associated with model selected by ID after save the template and reload and re init the editor. But I can...
Issue #1198
QUESTIONS : Find element in Model
I have custom component and it render below html, I want to update value of h4 tilte and other element on trait changed, but not sure how c...
Issue #1904
Get change in property float
I'm trying to listen to the change in the 'float' property whether it was shifted to the 'left' or 'right' or 'none' in Style Manager using...
Issue #1822
[QUESTION] - Add style sector for specific Css rule
Hey @artf , COuld you give your help on this one? I want to disable the user to able to select the wrapper block (body) but I still want to...
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.