flutter_typeahead
flutter_typeahead copied to clipboard
suggestion Box is not Closing As we tap on the Outside OF Suggestion
suggestion Box is not Closing As we tap on the Outside OF Suggestion That is Too much Annoying Can You please Provide Solution For it ???
Facing same issue. any update or workaround on this issue ??
+1
Facing same issue. any update or workaround on this issue ?? @
Cannot say proper Solution But You can try out this With TypeAhead =>when you Click outside of the suggestion Box you can just hide Your keyboard So suggestion box will also disapper
You can Just give onTap to your Conatiner Or Any Area on which you Click you want To Close Your Suggestion Box . And inside onTap Just Use SystemChannels.textInput.invokeMethod('TextInput.hide'); this line of code e.g `InkWell(
onTap:(){ SystemChannels.textInput.invokeMethod('TextInput.hide');
} child:Container(child:TypeAheadField( textFieldConfiguration: TextFieldConfiguration( autofocus: true, style: DefaultTextStyle.of(context).style.copyWith( fontStyle: FontStyle.italic ), decoration: InputDecoration( border: OutlineInputBorder() ) ), suggestionsCallback: (pattern) async { return await BackendService.getSuggestions(pattern); }, itemBuilder: (context, suggestion) { return ListTile( leading: Icon(Icons.shopping_cart), title: Text(suggestion['name']), subtitle: Text('$${suggestion['price']}'), ); }, onSuggestionSelected: (suggestion) { Navigator.of(context).push(MaterialPageRoute( builder: (context) => ProductPage(product: suggestion) )); }, ))
) `
+1
U can just check this out
@sjmcdowall any chance this issue will be addressed? There is a duplicate of it here github.com/AbdulRahmanAlHamali/flutter_typeahead/issues/169 and it seems like very common behavior.
For those who are seeking for an answer the easiest and the best I could came up with is described here https://stackoverflow.com/questions/51652897/how-to-hide-soft-input-keyboard-on-flutter-after-clicking-outside-textfield-anyw
+1