flutter_typeahead icon indicating copy to clipboard operation
flutter_typeahead copied to clipboard

suggestion Box is not Closing As we tap on the Outside OF Suggestion

Open anilthapa1939 opened this issue 4 years ago • 7 comments

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 ???

anilthapa1939 avatar Dec 26 '20 10:12 anilthapa1939

Facing same issue. any update or workaround on this issue ??

SameerChorge94 avatar Feb 19 '21 05:02 SameerChorge94

+1

davebound avatar Mar 04 '21 13:03 davebound

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) )); }, ))

) `

anilthapa1939 avatar Mar 04 '21 15:03 anilthapa1939

+1

U can just check this out

anilthapa1939 avatar Mar 04 '21 15:03 anilthapa1939

@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.

SanjiKir avatar Jun 16 '21 19:06 SanjiKir

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

SanjiKir avatar Jun 16 '21 19:06 SanjiKir

+1

Gavin0x0 avatar Oct 19 '22 07:10 Gavin0x0