AbdulRahmanAlHamali/flutter_typeahead

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

Simileholluwa opened this issue · 2 comments

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
TypeAheadField<dynamic>(
          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
[Paste your logs here]

Screenshots or Video

Screenshots / Video demonstration [Upload media here]

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