Closed abdulwahhabkhan closed 3 years ago
@abdulwahhabkhan Is this really a bug of library? What I understand, is that the value which you are setting on Select component no longer exists in the list options, yes?
So we should reproduce the issue like this:
<SelectSearch
value='xxl'
id="test-id"
options={[
{ value: 's', name: 'Small' },
{ value: 'm', name: 'Medium' },
{ value: 'l', name: 'Large' },
]}
placeholder="Choose a size"
/>
I've tried this and didn't get any error.
@manvydasu Valid point. And I can't reproduce it either. Thanks for the help!
@abdulwahhabkhan Looking at the error, it seems that there is an option that is undefined in the options list.. If you have time, could you create a reproducible test case on codesandbox? I'll close this one for now, but will happily reopen it if you have any more info.
Options:
Value:
'fr'
Code:
Scenario is:
Fr french was in the list of available options get saved in DB, but now do the change request this option is not available.
Any user who already have selected this option now getting the following error:![image](https://user-images.githubusercontent.com/4024244/91994905-0e74c180-ed2f-11ea-8848-b8eef948738b.png)
Load time error I was able to remove by adding a check for the option exists before return value.
But when I now try to choose any other option getting above error.