esentis / multiple_search_selection

A highly customizable multiple selection widget with fuzzy search functionality.
https://pub.dev/packages/multiple_search_selection
BSD 3-Clause "New" or "Revised" License
11 stars 13 forks source link

showedItems are still displayed when the onType flag is used and clearSearchFieldOnSelect is set to true #30

Closed Pherne closed 1 year ago

Pherne commented 1 year ago

Current Behavior

The onType flag is used and clearSearchFieldOnSelect is set to true. After I have added an item to the pickedItems showedItems are visible. It works as intended when I manually empty the searchField.

Expected behavior/code

showedItems aren't visible after adding an item to the pickedItems when the onType flag is used and clearSearchFieldOnSelect is set to true

Possible Solution

Adding something along the lines of setState(() => expanded = widget.itemsVisibility == ShowedItemsVisibility.onType && widget.searchFieldTextEditingController.text.isNotEmpty); in the onTap of the GestureDetector in _buildShowedItems().

esentis commented 1 year ago

Hello there ! Very good catch, indeed there was a bug. I have resolved it and now the showedItems will no longer be shown when itemsVisibility == ShowedItemsVisibility.onType & clearSearchFieldOnSelect == true.

Will be available with the next release 2.4.4, probably later today.