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 filters by value only instead of value & text

See original GitHub issue

When I use an Autocomplete from this package, it seems to set the value of the autocomplete field as the input from the textbox. This is fine when I search for anything that is not contained in the ‘value’ field of my dataset but, as soon as I enter a value that is part of the dataset’s value field, it automatically assigns that option as the only possible option. The normal ant autocomplete will keep showing me available options from the dataset’s text field.

A possible fix could be to only set the Autocomplete’s value attribute when an option is SELECTED and not when text is being typed into the input box.

As an example, if I have the following data:

[
{value: 0, text: 'Test'},
{value: 1, text: 'Text With 2'},
{value: 2, text: 'Text With 1'},
]

And I type in a ‘1’ into the input box, the selected value will automatically become the second element {value: 1, text: 'Text With 2'}, even though I would expect it to also show me {value: 2, text: 'Text With 1'} as an option.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
jannikbuschkecommented, Dec 20, 2019

Should be fixed in v1.6.2

1reaction
thj-dkcommented, Apr 7, 2020

No worries. We’ll prioritize upgrading to antd4 asap. Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why AutoComplete does not filter using text field | JavaScript
In EJ2 AutoComplete, the search and filter works based on the value field alone. Mapping text field for AutoComplete will only update the...
Read more >
mat-autocomplete key value filter issue
Save this question. Show activity on this post. I am using angular material autocomplete to filter data, each option has name and value....
Read more >
AutoComplete filters on value, not text · Issue #13171
Type "z" in the AutoComplete text box. Nothing is filtered. What is expected? "Zidane" element should be filtered. What is actually happening?
Read more >
jQuery UI Autocomplete - Filter words starting with term
// Overrides the default autocomplete filter function to // search only from the beginning of the string $.ui.autocomplete.filter = function ( ...
Read more >
Angular Material Filtering Autocomplete with Required ...
We want to use an Autocomplete so that the user can start typing and we will filter the list down to only characters...
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