Issue #1543💬 AnsweredOpened October 26, 2018by TommyLjung0 reactions

Enable Traist-checkbox by default

Quick answerby artf

If you use changeProp you get the value from the component value, eg: without changeProp, it would be:

Read full answer below ↓

Question

Hi.

I am new to GrapesJs and really liking it so far. But now I have a (probably beginner) question:

How can I make a trait-checkbox be selected by default? I have tried with: traits: [ { type: 'checkbox', label: 'Loop', name: 'model-loop-bool', changeProp: 1, selected: 'true', }],

But "selected" or "checked" is not the right attribute to set, can someone please help me with this basic thing?

Thanks!

Answers (2)

artfNovember 2, 2018

If you use changeProp you get the value from the component value, eg: without changeProp, it would be:

lock[bot]November 2, 2019

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.

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.