question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Autocomplete dropdown still occurs even when I have selected element from the dropdown.

See original GitHub issue

Description

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

  1. 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- step1

  1. 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-

step2

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]

  1. It will look something like this- step1

  2. 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-

step2

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:closed
  • Created 5 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
alextrasterocommented, May 4, 2018

Thanks for spotting this @lovingyugs, we’ll check it out ASAP

0reactions
alextrasterocommented, Jun 18, 2018

Fixed by @niross and published to 2.3.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Autocomplete dropdown does not clear once a selection is ...
I clicked/chose an option and the items from the dropdown persisted and weren't cleared from the DOM. I also have no idea why...
Read more >
Jquery autocomplete on select event - Stack Overflow
When someone types any word jQuery shows suggestion dropdown, if someone select an item from that suggestion dropdown. I want to capture above...
Read more >
Auto complete text in a drop down list cell
Hi everyone, Trying to do a spreadsheet and figured out how to make the drop down list box (yay). But I would like...
Read more >
Javascript Autocomplete Dropdown - YouTube
In a high performing user friendly website, we use the autocomplete feature to give the user the ability to search on a list...
Read more >
Autocomplete input dropdown | HTML, CSS, JS - YouTube
Create a autocomplete input dropdown with HTML, CSS and JavaScript.Join the community on Discord:https://discord.gg/cWqA6hPr.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found