1. This happens only for fields inside blocks.
2. If you add the same field inside tab or top level of the document it behaves as expected
P.S: These are payload components
I agree - this doesn't behave as one would expect. In your case, would it work if you set
admin.readOnly: true
Alternatively if you want to hide the fields for certain users, but leave available for admins, you could use
admin.condition
:
condition: (_data, _sib, { user }) => user?.role === "admin",
Yes,
readOnly
works as expected
This works. Would prefer it to a disabled field else will go with this approach. Thanks 🙌
Raising this as a bug 🙂
https://github.com/payloadcms/payload/issues/2724
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.