You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tab inside group with conditional that is refer with a selection of value tab is not changing the field correctly inside the tab.
Expected Behavior
The expected behaviour is, when you change the tab into another tab, the field text with data is keep
Current Behavior
Current behaviour is the value inside text field is persist even we switched the tab
Possible Solution
Steps to Reproduce
Create invitation collection
Copy attached code
yarn dev
import{CollectionConfig}from"payload/types";importListInvitationfrom"../components/Invitations/ListInvitation";import{isAdmin,isAdminOrCreatedBy}from"../utils/accessRole";constInvitation: CollectionConfig={slug: "invitations",admin: {useAsTitle: "slug",description: "This is where you create your invitation, atm, the system only accept one invitation per-user :)",components: {views: {List: ListInvitation,},},},access: {read: isAdminOrCreatedBy,create: async(ctx)=>{if(isAdmin(ctx))returntrue;// check in db how many invitation is already created by the userconstinvitation=awaitctx.req.payload.find({collection: "invitations",where: {createdBy: {equals: ctx.req.user.id,},},});// make sure only one invitation are able to be created by the userif(invitation.totalDocs===0)returntrue;returnfalse;},update: isAdminOrCreatedBy,delete: isAdminOrCreatedBy,},fields: [{label: "URL Invitation",name: "slug",type: "text",required: true,unique: true,// need to add localized to have a unique properties in mongolocalized: false,admin: {position: "sidebar",},},{label: "Invitation Type",type: "select",name: "type",options: [{label: "Wedding",value: "wedding",},{label: "Metatah",value: "metatah",},],},{label: "Wedding",type: "group",name: "wedding",admin: {description: "Please fill all the details for your next wedding invitation",condition: (data)=>{if(data.type==="wedding"){returntrue;}returnfalse;},},fields: [{label: "Identity Details",type: "tabs",tabs: [// Cowok{label: "Groom Details",description: "Here is the detail for the Groom (Male)",fields: [{label: "Groom Name",type: "row",fields: [{label: "Full Name (Groom)",name: "groom-name",type: "text",admin: {width: "80%",},},{label: "Birth Order (Groom)",name: "groom-birthorder",type: "number",admin: {width: "20%",},},],},{label: "Parent Name (Groom)",type: "row",fields: [{label: "Mother Name (Groom)",name: "groom-mother",type: "text",},{label: "Father Name (Groom)",name: "groom-father",type: "text",},],},],},// Cewek{label: "Bride Details",description: "Here is the detail for the Bride (Female)",fields: [{label: "Bride Name",type: "row",fields: [{label: "Full Name (Bride)",name: "bride-name",type: "text",admin: {width: "80%",},},{label: "Birth Order (Bride)",name: "bride-birthorder",type: "number",admin: {width: "20%",},},],},{label: "Parent Name (Bride)",type: "row",fields: [{label: "Mother Name (Bride)",name: "bride-mother",type: "text",},{label: "Father Name (Bride)",name: "bride-father",type: "text",},],},],},],},{label: "Wedding Location",name: "wedding-location",type: "point",},],},{name: "createdBy",type: "relationship",relationTo: "users",access: {update: ()=>false,},admin: {// TODO: this need to be hide whenever the development phase endhidden: true,readOnly: true,position: "sidebar",condition: (data)=>Boolean(data?.createdBy),},},],hooks: {beforeChange: [({ req, operation, data })=>{if(operation==="create"||operation==="update"){if(req.user){data.createdBy=req.user.id;returndata;}}},],},};exportdefaultInvitation;
Bug Report
Tab inside group with conditional that is refer with a selection of value tab is not changing the field correctly inside the tab.
Expected Behavior
The expected behaviour is, when you change the tab into another tab, the field text with data is keep
Current Behavior
Current behaviour is the value inside text field is persist even we switched the tab
Possible Solution
Steps to Reproduce
Detailed Description
Payload version: 1.0.19
Browser: Chrome
Database: MongoDB Atlas
The text was updated successfully, but these errors were encountered: