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 🌈
https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/Select/SelectInput.js#L14
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.
Summary 💡
I'm facing an issue where I'm getting the
You have provided an out-of-range valuewarning in theSelectcomponent 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 (namelyid) so it should still recognize that this is the same object.Examples 🌈
https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/Select/SelectInput.js#L14
I propose making
areEqualValuesthe default value for an optional prop on theSelectInputcomponent, which can be overridden by a custom validation function.I'd like to do
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.