Allow to unset the value of a non-required enum with the Dropdown Edit Widget

What is the feature?

When using a non-required enum in the forest-admin schema such as:

{
      "field": "outcome",
      "type": "Enum",
      "defaultValue": null,
      "enums": [ "Approved", "Rejected"],
      "integration": null,
      "isFilterable": true,
      "isReadOnly": false,
      "isRequired": false,
      "isSortable": true,
      "isVirtual": false,
      "reference": null,
      "inverseOf": null,
      "validations": []
    }

you cannot reset the value to null in Forest Admin.
It would be nice to have a way to do this (an empty value in the dropdown or a button to empty it)

What problem does this solve for you?

I’m forced to add a ‘dummy’ value in the select that I map to null in my code. It would be much simpler to have the front send the null value directly.

Who else would be using this feature?

Anybody using editable non-required dropdowns. I can’t tell much more…

Hey, @Vincent_Francois !
Thanks for the suggestion, I’m pushing it to our product team :slight_smile:

1 Like