ukrbublik / react-awesome-query-builder

User-friendly query builder for React
https://ukrbublik.github.io/react-awesome-query-builder
MIT License
2.02k stars 504 forks source link

Material UI multiselect widget throws error when a user adds a new custom value #525

Closed sjakos closed 3 years ago

sjakos commented 3 years ago

Describe the bug When a new value is being added to the Material UI multiselect widget with allowCustomValues=true the input change fails and throws an error.

To Reproduce Add a Material multiselect widget to a query builder with allowCustomValues=true Attempt to add a new value to the multiselect through the text input

Expected behavior The new string value should be added to the array of values for the multiselect

Screenshots image

Additional context

The error is being thrown from this line https://github.com/ukrbublik/react-awesome-query-builder/blob/12ec9fec17f35ec510618bc7ea6e22c1009ef2ee/modules/hooks/useListValuesAutocomplete.jsx#L151

The MUI Autocomplete component returns a string rather than the object the useListValuesAutocomplete hook is expecting.

ukrbublik commented 3 years ago

Mutiselect with custom values is not yet supported for MUI. In my todo list https://github.com/ukrbublik/react-awesome-query-builder/blob/12ec9fec17f35ec510618bc7ea6e22c1009ef2ee/modules/hooks/useListValuesAutocomplete.jsx#L175-L176

ukrbublik commented 3 years ago

Closing as duplicate to #327