-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Description
- I have searched the issues of this repository and believe that this is not a duplicate.
Summary 💡
I'm facing an issue where I'm getting the You have provided an out-of-range value warning in the Select component because my objects are failing the comparison check. This is because my initial value is not an object from the available options list, but an object I retrieved from the server with which I'm initializing my form. However all the properties are the same (namely id) so it should still recognize that this is the same object.
Examples 🌈
I propose making areEqualValues the default value for an optional prop on the SelectInput component, which can be overridden by a custom validation function.
I'd like to do
<Select validateOption={(a, b) => a.id === b.id} />Motivation 🔦
Even though my objects fail the equality check, they're still representing the same database entity, so I should be able to customize the validation myself.