flutter_typeahead icon indicating copy to clipboard operation
flutter_typeahead copied to clipboard

Not working on Safari flutter 2.10.0

Open rutaba1 opened this issue 3 years ago • 2 comments

Hi, recently I upgraded to flutter 2.10.0 and before that typeahead was working fine on Safari. But now I can not type text in the TypeAheadFormField.

rutaba1 avatar Feb 11 '22 21:02 rutaba1

Same situation for me after upgrading to Flutter 2.10.0.

Flutter 2.10.0-0.3.pre • channel beta • https://github.com/flutter/flutter.git Framework • revision fdd0af78bb (3 weeks ago) • 2022-01-25 22:01:33 -0600 Engine • revision 5ac30ef0c7 Tools • Dart 2.16.0 (build 2.16.0-134.5.beta) • DevTools 2.9.2

flutter_typeahead version 3.2.4

Works perfectly on Chrome and Firefox, but on Safari 15.3 (Mac OS 12.2) the TypeAheadFormField will not accept any keyboard input. The field accepts focus and a cursor appears, but nothing appears in the field. A suggestionsCallback is called with an empty string, and if I select something from the typeahead suggestion dropdown it does populate the field. Yet still no keyboard input is received.

Standard Flutter TextFormField's I have on the same page all work and behave normally.

The Safari behaviour occurs both in development and in an instance deployed to Firebase hosting.

I'm not sure how to debug further as no console errors appear in Safari's js console.

ADDIT:

Tested both TypeAheadField and TypeAheadFormField and both show same behaviour.

Here's an example of how I am using it to allow a user to tag a record:

TypeAheadFormField(
  textFieldConfiguration: TextFieldConfiguration(
    textInputAction: TextInputAction.go,
    onSubmitted: (value) {
      controller.addTag(value);
      controller.tagsController.clear();
    },
    decoration: InputDecoration(
      filled: true,
      prefixIcon: Icon(Icons.local_offer),
      labelText: "Add Tags",
    ),
    controller: controller.tagsController,
  ),
  suggestionsCallback: (pattern) {
    return controller.eventController.getSuggestions('tags', pattern);
  },
  itemBuilder: (context, suggestion){
    return ListTile(
      title: Text(suggestion),
    );
  },
  autoFlipDirection: true,
  hideOnEmpty: true,
  onSuggestionSelected: (suggestion) {
    controller.addTag(suggestion);
    controller.tagsController.clear();
  },
),

djol avatar Feb 14 '22 06:02 djol

Good news @rutaba1 - this issue was identified as Flutter #96411 for 2.10 and has been fixed in beta, 2.11.0-0.1.pre.

Go do a flutter upgrade to get this goodness! I just upgraded and confirmed the problem is fixed in both my dev system and in production when deployed to firebase.

djol avatar Feb 17 '22 06:02 djol

Good news @rutaba1 - this issue was identified as Flutter #96411 for 2.10 and has been fixed in beta, 2.11.0-0.1.pre.

Go do a flutter upgrade to get this goodness! I just upgraded and confirmed the problem is fixed in both my dev system and in production when deployed to firebase.

still not working on Flutter 3.7.0....

Ahmadre avatar Jan 25 '23 15:01 Ahmadre

No, it has been working from Flutter 2.10 to 3.3.

Now in 3.7 there is a new, different issue related to onSuggestionSelected not being called (as per #446).

djol avatar Jan 26 '23 04:01 djol