I have a background select field with two options - white and dark. The "white" option is the default one.
I expect that if I don't touch the field within the Prismic writing room, it would be "white" by default. However, this is not the case - instead it outputs as "undefined". Only when I go to the dashboard, open the dropdown, select "dark", then back to "white", it renders the correct value.
The "undefined" value impacts the UI of my app so it's crucial for the default value to be "white"
I believe this is because pushing Custom Type changes to your repository won't trigger an update inside the documents. If the document already existed and you add a new field, you need to perform a change inside of it to see the default field reflected.
These changes should be manual, so there are no unexpected document changes, redeploys, webhooks being fired, etc. An editor always triggers changes.
@Pau I just tested it further and it seems to be happening only if the select field is in a slice. If it's in the static zone, it's rendered correctly from the start without manually having to change the field in order for it to take effect.
@Pau I just noticed that the same thing is happening with Boolean fields.
I need to manually change the field back and forward in order for the field to be updated.
I'd consider this a critical bug as it says one thing within the Prismic writing room while the API delivers another information. Content writers can be confused by it