Issue #3328✓ SolvedOpened March 9, 2021by D-Rosa992 reactions

How can I update the nodeValue (text value) of components by inputs forms

Quick answerby artf2

Just find the component and update it as you wish

Read full answer below ↓

Question

Hello.

Grapesjs is a great tool. Thanks for it.

I want to update the text value of a component by inputs, how can I do that?? if a user filled the input box with something like: TEA SITE, the title should change to it

image

Answers (4)

👍 Most helpfulartfMarch 21, 2021

Just find the component and update it as you wish

const typedByUser = 'type something...';
const cmp = editor.getWrapper().find('.any-query-selector')[0];
cmp && cmp.components(typedByUser);
millordMarch 9, 2021

I'm also want something similar with my grapes app, but using react to update a text component via a control input. Somebody can help with that?

D-Rosa99March 22, 2021

it works, thanks

GJSBlockMay 17, 2026

Thanks for reporting this, @D-Rosa99. Great question about How can I update the nodeValue (text value) of components by inputs forms. The recommended approach with Components is to use the event-driven API. Start here: Check the GrapesJS documentation for your specific module Look for the on() even...

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

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.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.