[Autocomplete] TypeError: (intermediate value)(intermediate value)(intermediate value).filter is not a function
See original GitHub issueI am integrating autocomplete component in my website
it is crashing when we type anything in the autocomplete field
it is giving following error
Uncaught TypeError: (intermediate value)(intermediate value)(intermediate value).filter is not a function in autocomplete
My code:
<Autocomplete
multiple
id="checkboxes-tags-demo"
options={users}
disableCloseOnSelect
size="small"
value={values.userIds}
getOptionSelected={(option, value) => option.id == value.id}
getOptionLabel={(option) => option.firstName + ' ' + option.lastName}
renderOption={(option, { selected }) => (
<React.Fragment>
<Checkbox
icon={icon}
checkedIcon={checkedIcon}
style={{ marginRight: 8 }}
checked={selected}
// onChange={(e) => console.log('called12', e.target.value)}
/>
{option.firstName + ' ' + option.lastName}
</React.Fragment>
)}
style={{ width: '100%' }}
renderInput={(params) => (
<Field {...params} label="All Users" fullWidth name="userIds" component={TextField} />
)}
onChange={(event, val) => {
if (val !== null) {
const items = [];
val.map((v) => items.push(v));
setFieldValue('userIds', items);
}
}}
/>
my values:
values.userIds = [1,2]; users = [ {id:1,firstName:‘A’, lastName:‘B’}, {id:2,firstName:‘P’, lastName:‘Q’}, {id:3,firstName:‘X’, lastName:‘Y’},];
it is working fine on every other case like clicking on dropdown icon and then choosing the option or removing it by clicking on close icon
but crashing when we start to type anything in the field
Thanks
Issue Analytics
- State:
- Created 3 years ago
- Comments:15 (4 by maintainers)
Top Results From Across the Web
[Autocomplete] TypeError: (intermediate value ... - GitHub
[Autocomplete] TypeError: (intermediate value)(intermediate value)(intermediate value).filter is not a function #24785.
Read more >Uncaught TypeError: (intermediate value)(...) is not a function
The error is a result of the missing semicolon on the third line: window.Glog = function(msg) { console.log(msg); }; // <--- Add this...
Read more >TypeError (intermediate value)(...) is not a function in JS
The "TypeError: (intermediate value)(...) is not a function" error occurs when we forget to place a semicolon between a function declaration and an...
Read more >uncaught typeerror: schema[(intermediate value ... - You.com
The value is called an "intermediate value" because calling the getNum function does not produce the final result of the expression. We later...
Read more >TypeError: (intermediate value).at is not a function
Change peopleContract to this: var peopleContract = new ETHEREUM_CLIENT.eth.Contract(peopleContractABI, peopleContractAddress);.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I fixed the issue actually formik textfield was assigning a value string to the variable. I am now using material ui textfield and it is working fine For people who might get this issue in future
in renderInput function of autocomplete just change
to
<MuiTextField {...params} label="All Users" fullWidth />Note: MuiTextfield is material ui textfield and Textfield is formik Textfield
Thanks
In my case I was passing string as default value
defaultValue={selectedDiagnosis}while usingmultiplevariant. I just changed the selectedDiagnosis as array and all went well.