AbdulRahmanAlHamali / flutter_typeahead

A TypeAhead widget for Flutter, where you can show suggestions to users as they type
BSD 2-Clause "Simplified" License
831 stars 349 forks source link

suggestionCallback does not get called when the builder property returns a textfield #593

Closed Simileholluwa closed 4 months ago

Simileholluwa commented 4 months ago

Steps to reproduce

  1. Add the builder property
  2. Return a textfield

Expected results

suggestionCallback function gets called

Actual results

suggestionCallback does not get called

Package Version

5.2.0

Platform

Android

Code sample

Code sample ```dart TypeAheadField( builder: (context, _, focusNode) { return TextFormField( controller: widget.textEditingController, style: Theme.of(context) .textTheme .bodyMedium, textCapitalization: TextCapitalization.sentences, // onChanged: (value) { // controller.state.postText.value = // value; // }, decoration: InputDecoration( border: InputBorder.none, focusedBorder: InputBorder.none, enabledBorder: InputBorder.none, errorBorder: InputBorder.none, hintMaxLines: 1, hintText: "what's new in politics?", counter: const SizedBox(), contentPadding: const EdgeInsets.only( top: TSizes.sm, bottom: TSizes.sm, ), ), keyboardType: TextInputType.multiline, textInputAction: TextInputAction.newline, maxLength: 1500, maxLines: null, ); }, ---------------- ```

Logs

Logs ```console [Paste your logs here] ```

Screenshots or Video

Screenshots / Video demonstration [Upload media here]
clragon commented 4 months ago

Please see the FAQ: https://github.com/AbdulRahmanAlHamali/flutter_typeahead?tab=readme-ov-file#my-suggestions-arent-changing-when-i-type

Simileholluwa commented 4 months ago

Thanks, I solved this issue by passing the focusNode from the builder to the Textfield returned by the builder.