Issue #3019Opened September 11, 2020by sircoko0 reactions

[QUESTION] - Bind inner text/html (like div, p, h1) to Trait

Question

Hi! I've created a custom trait, and I want to be allowed to change the content of the tags (in this case it's a H1 tag) based on the trait values..

It would be awesome if it can be bi-directional; changes in the traits panel will update the canvas and also changes in the canvas would update the input in the panel.

I've tried a lot of approaches with no success at all.

Do you have any clue?

Answers (3)

artfSeptember 14, 20200 reactions

changes in the canvas

What kind of changes? How would you like to change the tag of the element in the canvas?

sircokoSeptember 14, 20200 reactions

No, i want to change the content.

for example

<p> $CHANGE_THIS </p>

artfSeptember 14, 20200 reactions

onUpdate function in the custom trait definition allows you to update the input as you wish (in the example you see how the component parameter is passed and used to update the trait value)

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.