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

Dropdown list is not reset when setThredshold(0) #411

Open
jasontruong opened this issue Jan 31, 2021 · 3 comments
Open

Dropdown list is not reset when setThredshold(0) #411

jasontruong opened this issue Jan 31, 2021 · 3 comments

Comments

@jasontruong
Copy link

This can be reproduce by ExampleActivity:

  1. Set Thredshold(0) in completionView
  2. In email completeView, type "ma". Dropdown list will appear, then select the first item. The dropdown will be dismissed
  3. Click on the completionView again. The dropdown is appeared as if filtered by "ma", although user didn't type anything. The only way to reset full dropdown list is type some random character, then delete it.

If you know any way to walk around this. Please advise :) Thank you

@jasontruong
Copy link
Author

Oh, you may need to add completionView.showDropDown in onClickListener() for dropdown to show when onClick

@mgod
Copy link
Contributor

mgod commented Feb 1, 2021

Yes, this is correct. Threshold of 0 is ignored and supposed to be set to 1 (see https://developer.android.com/reference/android/widget/AutoCompleteTextView#setThreshold(int)). It sounds like I may have missed a spot that needs to pay attention to this.

I think you should be able to work around this by calling performFiltering("", 0) in your subclass or calling adapter.getFilter().filter("") on your adapter, which should reset the list.

@jasontruong
Copy link
Author

Thank you very much! I was not aware this is by design from AutoCompleteTextView. :O :O

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