react-awesome-query-builder
react-awesome-query-builder copied to clipboard
Pass to MuiFieldSelect customProps not working
Describe the bug I try to pass customProps to MuiFieldSelect from @react-awesome-query-builder/mui library to customize renderOperator. I want show operator options as LTR in my RTL MUI project.
Passing customProps to MuiFieldAutocomplete works.
To Reproduce
For example, just trying to pass backgroundColor: yellow to customProps doesnt work:
// passing settings to config.
settings: {
...MuiConfig.settings,
// customProps works for renderField, but not for renderOperator
renderField: (fieldProps) => <MuiFieldAutocomplete {...fieldProps} customProps={{ style: { backgroundColor: 'yellow' } }} />,
renderOperator: (operatorProps) => <MuiFieldSelect {...operatorProps} customProps={{ style: { backgroundColor: 'yellow' } }} />,
}
As you can see, only renderField receive yellow color:
Expected behavior Both MuiFieldSelect and MuiFieldAutocomplete declares that they receive FieldProps, but only MuiFieldAutocomplete uses customProps in it.
I see in implementation that MuiFieldAutocomplete does pass customProps (inside "rest"): https://github.com/ukrbublik/react-awesome-query-builder/blob/d17da0103e90c96d3aa081304129b2b355b89c9a/packages/mui/modules/widgets/core/MuiFieldAutocomplete.jsx#L39-L43
but in MuiFieldSelect the customProps is not deconstructed at all: https://github.com/ukrbublik/react-awesome-query-builder/blob/d17da0103e90c96d3aa081304129b2b355b89c9a/packages/mui/modules/widgets/core/MuiFieldSelect.jsx#L8-L11