Hide/show traits and change their values dynamically
You've called the trait name: 'select-type', but you're listening to change:selectType, so fix it by changing the listener in change:select-typeDon't rely on the trait value this.getTrait('select-type').props().value but on the component itself this.get('select-type') Currently you can't update traits attributes in th...
Read full answer below βQuestion
I have extended the link component and add new traits like href. In order to show or hide the trait i followed this #https://github.com/artf/grapesjs/issues/1460. But how to show those hide traits again on the basis of another trait change value? Right now what i have done is But its not reflecting the changes in the component setting. Can we change the style of trait like hide/show dynamically. Can we assign select-type trait value to path-name trait value or do i need to implement custom types for that?
Answers (2)
You've called the trait name: 'select-type', but you're listening to change:selectType, so fix it by changing the listener in change:select-typeDon't rely on the trait value this.getTrait('select-type').props().value but on the component itself this.get('select-type') Currently you can't update tra...
getTrait('ID').view is undefined.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #3778
Select options are not displaying - new anomaly
GrapesJS version[X] I confirm to use the latest version of GrapesJSWhat browser are you using? ChromeReproducible demo link https://github....
Issue #3404
Style Manager Issue.
Hi @artf I want to hide and show style properties for specific component. After referencing this issue https://github.com/artf/grapesjs/iss...
Issue #5141
component resets attribute values on updating traits ( first time only )
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome Version 113.0.5672.63 Reproducible...
Issue #1113
[QUESTIONS] New trait type is not working with rendered components?
Hello, thanks for the great framework. I'm trying to apply this to my project. I want to add a new trait for existing LINK '<a>' component....
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.