Bug: Autosuggest throws an exception when value is 'number'
See original GitHub issueFor my form I need to pre-fill the value from server which end up as Integers.
But when I try to pass that to Autosuggest it fails, It does not have issues with String. Those work just fine
https://codepen.io/anon/pen/QQaxeP
Uncaught TypeError: (intermediate value)(intermediate value)(intermediate value).trim is not a function
at Autosuggest.getQuery (Autosuggest.js:280)
at Autosuggest.render (Autosuggest.js:497)
at finishClassComponent (react-dom.development.js:7873)
at updateClassComponent (react-dom.development.js:7850)
at beginWork (react-dom.development.js:8225)
at performUnitOfWork (react-dom.development.js:10224)
at workLoop (react-dom.development.js:10288)
at HTMLUnknownElement.callCallback (react-dom.development.js:542)
at Object.invokeGuardedCallbackDev (react-dom.development.js:581)
at invokeGuardedCallback (react-dom.development.js:438)
at renderRoot (react-dom.development.js:10366)
at performWorkOnRoot (react-dom.development.js:11014)
at performWork (react-dom.development.js:10967)
at batchedUpdates (react-dom.development.js:11086)
at batchedUpdates (react-dom.development.js:2330)
at dispatchEvent (react-dom.development.js:3421)
Issue Analytics
- State:
- Created 6 years ago
- Reactions:13
- Comments:8
Top Results From Across the Web
React Autosuggest throwing error on clicking the suggestions
When you click a suggestion, the value of the "value" key in the inputProps is undefined thats the reason that you are getting...
Read more >445727 - Web form autocomplete throws uncaught exception when ...
Open and clear the error console 2. Go to a page (eg. google.com) with an input text box that you've used before 3....
Read more >Enter custom value causes exception in Blazor WASM ...
The following exception occurs when we type a custom value and press enter in allowCustom enabled autocomplete. Error: System.
Read more >Autocomplete FormField throws error and no results
06.09.2018 13:27:40 ERROR - Controller Form has raised an exception in Action ReloadAutoCompleteField. System.NullReferenceException: Der Objektverweis wurde ...
Read more >Errors - discord.js Guide
This error is caused by spawning a large number of event listeners, usually for the client. The most common cause of this is...
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
Seems like, the value parameter expects a string. Converting the value to a string using toString resolved the problem for me.
In the onChange handler, I was using
event.target.value
to update my value. When I used the de-structured value of the second parameter(event, { newValue })
, it worked. Thanks for this.