MaterialChipsInput icon indicating copy to clipboard operation
MaterialChipsInput copied to clipboard

hide the filterable list + request focus to open keyboard

Open crearo opened this issue 6 years ago • 1 comments

For the most part of it, this library is great. However, I've been pulling my hair over simple issues.

  1. How do I hide the filterable list manually? Once it's open, there's no way to close it other than clicking an item. I've tried
  • mChipsInput.setFilterableList(new ArrayList<ChipInterface>());
  • mChipsInput.getEditText().getFilterableListView().fadeOut();
  • mChipsInput.getEditText().getFilterableListView().fadeOut();
  • mChipsInput.getFilterableList().clear(), and called mChipsInput.invalidate() afterwards

The view logic is just so poorly designed, none of these seem to work. I've been digging into the source code and see that fadeOut() is to hide it from within the library. Why doesn't it work when used as an api?

  1. Open the soft-keyboard automatically when the mChipsInput is clicked. I've tried the following:

     mChipsInput.requestFocus();
     mChipsInput.getEditText().requestFocus();
     openKeyboard(mChipsInput.getEditText());  // this uses the InputManager to open the keyboard on this view.
     mChipsInput.getEditText().performClick();
    

Again, none of these work!

crearo avatar Apr 08 '18 16:04 crearo

Turns out it was a really silly line in the code that was causing the issue as for 1. I've sent a PR #99

It creates the edittext only once, instead of creating a new one each time getEditText is called.

crearo avatar Apr 08 '18 18:04 crearo