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

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

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 (3)

artfMarch 21, 20212 reactions

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, 20210 reactions

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, 20210 reactions

it works, thanks

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...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.