Closed ngranahan closed 3 years ago
I see Bea has assigned this to himself, missed that earlier, but FYI folks, here is a demo where it works:
https://github.com/apostrophecms/apostrophe-boilerplate/tree/boolean-def-demo
Looking at Nora's example, the difference could be the use of the "choices" option perhaps?
I am also unable to reproduce it this way:
addFields: [
{
type: 'boolean',
name: 'cool',
def: true,
choices: [
{ label: 'Yes', value: true },
{ label: 'No', value: false }
]
}
]
true
is working as the default for me here too.
@ngranahan I think we'll need a branch of apostrophe-boilerplate demonstrating the issue from you to move forward.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
theoretically I will be returning to this.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Yeah, I double checked as well with fields:
addFields: [
{
name: 'booleanFalse',
label: 'False boolean',
type: 'boolean',
def: false,
choices: [
{ label: 'Yes', value: true },
{ label: 'No', value: false }
]
},
{
name: 'booleanTrue',
label: 'True boolean',
type: 'boolean',
def: true,
choices: [
{ label: 'Yes', value: true },
{ label: 'No', value: false }
]
}
],
Both default as expected. I'll close until we have some more reproduceable info.
To Reproduce
def: true
false
Expected behavior
Setting
def: true
in a boolean schema field should set the default value of that field totrue
.Describe the bug
Setting
def: true
does not change the default value of the boolean field to true. Default is always set tofalse
.