[Autocomplete] with integers as options throw candidate.toLowerCase error
See original GitHub issuePlease see codesandbox at https://codesandbox.io/s/material-demo-ldh7x?file=/demo.js
- The issue is present in the latest release.
- I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior 😯
When an autocomplete options
prop is only integers, the following error comes:
useAutocomplete.js:44 Uncaught TypeError: candidate.toLowerCase is not a function
at useAutocomplete.js:44
at Array.filter (<anonymous>)
at useAutocomplete.js:40
at useAutocomplete (useAutocomplete.js:219)
at Autocomplete (Autocomplete.js:379)
at renderWithHooks (react-dom.development.js:14803)
at updateForwardRef (react-dom.development.js:16816)
at beginWork (react-dom.development.js:18645)
at HTMLUnknownElement.callCallback (react-dom.development.js:188)
at Object.invokeGuardedCallbackDev (react-dom.development.js:237)
Expected Behavior 🤔
The expected behaviour is to have the autocomplete showing the integers as options and returning them as a result.
Steps to Reproduce 🕹
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
[Autocomplete] with integers as options throw candidate ...
When an autocomplete options prop is only integers, the following error comes: useAutocomplete.js:44 Uncaught TypeError: candidate.
Read more >candidate.toLowerCase is not a function. (In ... - Stack Overflow
I am using AutoComplete API of material ...
Read more >AutoComplete returning "TypeError: "".toLowerCase is not a ...
If I uncomment ignoreCase: false, then I get the error: Uncaught TypeError: Object [object Object] has no method 'lastIndexOf'.
Read more >Apache FreeMarker Reference - Digital Assistant
Converts the date from the entity extraction to a string formatted as 11/17/18. The date operator tells FreeMarker that the variable only holds...
Read more >VMware InstallBuilder User Guide 22
This package allows autocompletion of XML documents against RELAX NG. ... Accessing an undefined variable will not throw an error. Instead, if the...
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 FreeTop 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
Top GitHub Comments
For me the issue was labels as integer.
const KEY_OPTIONS = [{value: 1, label: 1}, {value: 2, label: 2}, {value: 3, label: '3+'}];
I resolved like this.
getOptionLabel={(option) => option.label.toString()}
Asking as a user and not as a contributor. I am facing this issue. How do I solve this?