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
console.log(siblingData);
return siblingData?.overwriteMeta;
},
},
fields: [here condition works fine]
]}]
@chris_heinz I believe conditional tabs is on our roadmap still
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.