laravel-admin icon indicating copy to clipboard operation
laravel-admin copied to clipboard

List field: Not included in request if empty, entries stay

Open anxgstadler opened this issue 2 years ago • 0 comments

  • Laravel Version: 8.83.5
  • PHP Version: 8.0
  • Laravel-admin: 1.8.18

Description:

I have a list() field to edit a 1-dimensional array of strings as described here: https://laravel-admin.org/docs/en/model-form-json-fields#One-dimensional%20array I fill it with some entries and save. Then I want to remove the items, but they stay and won't go away. I see in the network monitor of my browser that the field is not included in the request at all, and I guess that's why the (empty) content of the field is not being handled in the first place to remove the saved entries.

Steps To Reproduce:

  1. Add list() field to $form: $form->list('sources')->max(10)->min(0);
  2. Add an item and save.
  3. Make sure the item has been saved.
  4. Edit again and remove item.
  5. Item is still there, no changes.

anxgstadler avatar Apr 12 '22 11:04 anxgstadler