Hide admin tab depending on sibling data

default discord avatar
5 months ago

I am trying to hide/show a tab if a certain field is checked. Unfortunately my code within the condition is never called. It works perfectly fine as expected if I do the same in fields within the tab but not on tab level. Is there another way to conditionally hide a whole tab?

fields: [
      type: "tabs",
      tabs: [
          label: "SEO"
           admin: {
            condition: (doc, siblingData) => {
              // does not get called so the scope is not even reached
              return siblingData?.overwriteMeta;
          fields: [here condition works fine]
  • discord user avatar
    Payload Team
    2 months ago

    @chris_heinz I believe conditional tabs is on our roadmap still

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


Connect with the Payload Community on Discord



Can't find what you're looking for?

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