Bug? saveToJWT ignored when used within a type 'tab' field

default discord avatar
altanbln
4 months ago
2

I've recently encountered a problem where fields that have

saveToJWT

set to true were not available for a

defaultValue

function in the payload admin when they were defined within a tabbed field.



I'm not sure if this is intended? but definitely threw me off and took me some time to debug. I encountered this when working off of code from the access-control-demo (

https://github.com/payloadcms/access-control-demo

). When I copy the

roles

field defined for users as

tabbedRoles

, move them into a tab. the values are not available for the

defaultValue

function

  • discord user avatar
    jesschow
    Payload Team
    2 months ago

    Hey @altanbln is this still happening on the latest version of Payload? If so, could you open an issue for us over on GitHub? It doesn't sound like intended behavior.

    https://github.com/payloadcms/payload/issues
  • default discord avatar
    altanbln
    2 months ago

    Hey @jesschow I've just tested this with the latest version of Payload. The defaultValue is populated as expected for fields within a tab, so I guess this bug is resolved!

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.