Autocomplete dropdown still occurs even when I have selected element from the dropdown.
See original GitHub issueDescription
In Autocomplete component, even after selecting any matching element from the list the list did not get away, if the list item is a substring in other list items, then the other list items keep on appearing.
What I want is that- If we have selected an item or element from the dropdown list, then the dropdown list should go away, which is not happening in the below example.
Steps to Reproduce
Check here on-react-materialize You can reproduce the error by following the below steps
- Replace the Autocomplete component code with this-
<Autocomplete
title='Company'
data={
{
'Apple': null,
'Microsoft': null,
'Google': 'http://placehold.it/250x250',
'Google again': null,
}
}
/>
It will look something like this-

- Now when you will type google and select the first element appearing on the list. Even after selecting the element the list did not go away, the drop-down list remains if the word is matching. See-

Expected behaviour: [What you expect to happen]
What I want is that- If we have selected an item or element from the dropdown list, then the dropdown list should go away, which is not happening in the below example.
Actual behaviour: [What actually happens]
-
It will look something like this-

-
Now when you will type google and select the first element appearing on the list. Even after selecting the element the list did not go away, the drop-down list remains if the word is matching. See-

Versions
You can check directly on the website, here- react-materialize
The version I am using in my code is- react-materialize: ^1.0.8 materialize-css: 0.100.1 react: 0.14.7
Thanks for helping out!
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (5 by maintainers)

Top Related StackOverflow Question
Thanks for spotting this @lovingyugs, we’ll check it out ASAP
Fixed by @niross and published to 2.3.1