#Disable Remove Row in Array Row?

11 messages · Page 1 of 1 (latest)

autumn abyssBOT
#

hey guys, can i disable the remove row in the array row?

steep sapphireBOT
#

Original message from @upbeat meadow - Moved from #general message

tacit idol
#

Hey @upbeat meadow

Unfortunately array actions are not removable at this time. The only way to prevent the Remove row array action is to specify your array field as readOnly

upbeat meadow
#

there should be a prop passed to ArrayField to override the default delete or add method, it would be a great feature. thanks for answring

tacit idol
#

My pleasure

steep sapphireBOT
upbeat meadow
celest cypress
#
  • one for this
#

In the mean time, you can work around it with CSS:

  1. Add an admin.className attribute to the array field
  2. if you have set up tailwind, just add sth like
.participants-array .array-actions__remove {
    display: none
}

with participants-array being your custom class

If you don't have tailwind set up, create a css file somewhere in the project and import it into app/(payload)/layout.tsx