Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autocomplete - doesn't show list if the entered text = one of the options #129

Closed
cstrat opened this issue Jul 6, 2021 · 3 comments
Closed

Comments

@cstrat
Copy link
Contributor

cstrat commented Jul 6, 2021

In most cases this is probably the expected behaviour, but there are edge cases which might want a flag to disable this.

With Autocomplete if you have entered the exact text of an option, the option list will not display even if there are options which still match the entered text.

For example if you had a data set of:

[John, John Butler, Johnny Drama, Johnny] - entering "John" would hide the other Autocomplete options.

I suggest there should be a toggle to disable this.

Reproduction:
https://codesandbox.io/s/mantine-autocomplete-syzs5?file=/src/App.js

My actual use case is the battery entry - there are many more options than that, but it is helpful to always see the matching options. You will see that the CR2020 option isn't even visible, if you type C it matches C and doesn't show an option. It would be good to still show matching CRxx options.

@cstrat
Copy link
Contributor Author

cstrat commented Jul 6, 2021

If you use the incorrect case, you can see the behaviour I think might be preferred in some scenarios.

(search 'john' in the first or 'c' in the battery example)

@rtivital
Copy link
Member

rtivital commented Jul 6, 2021

Yep, that's a bug, will fix it in 2.0.2, right now autocomplete checks if data has exact item, instead it should perform a regular search

@rtivital
Copy link
Member

rtivital commented Jul 6, 2021

Resolved with #135

@rtivital rtivital closed this as completed Jul 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants