Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] TextField Does Not Call Suggestions Callback On Flutter Web Only #595

Open
palak-nimblerx opened this issue Jul 18, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@palak-nimblerx
Copy link

Steps to reproduce

  1. Create a simple example using a text feild
  2. run on mobile (it will work as normal)
  3. run on chrome (the suggestions callback will not trigger as you type)

Note: I have read over the FAQ and similar issues and im passing the controller and focusnode to the TextFeild

Expected results

the suggestions callback should work as expected on all platforms

Actual results

the callback does not get called when using flutter web

Package Version

5.0.2

Platform

Web

Code sample

Code sample
Widget _searchInput(BuildContext context) {
    return TypeAheadField<JSON>(
      debounceDuration: Duration(milliseconds: 500),
      hideOnEmpty: false,
      hideOnError: true,
      direction: VerticalDirection.up,
      focusNode: fn,
      controller: _textEditingController,
      builder: (context, controller, focusNode) {
        return TextField(
          controller: controller,
          focusNode: focusNode,
          textAlignVertical: TextAlignVertical.center,
          style: nimbleTextTheme.bodyLarge,
          maxLines: 1,
          decoration: decoration(),
        );
      },
      suggestionsCallback: (pattern) async {
        .....
      },
      itemBuilder: (context, suggestion) {
         ......
      },
      emptyBuilder: (context) => Container(),
      loadingBuilder: (context) => Container(),
      onSelected: (suggestion) {
         ......
      },
    );
  }

Logs

Logs
no error logs are present 

Screenshots or Video

Screenshots / Video demonstration [Upload media here]
@palak-nimblerx palak-nimblerx added the bug Something isn't working label Jul 18, 2024
@UsamaKarim
Copy link

It doesn't seems to be called on other platforms as well

@carmas123
Copy link

Also on Windows

@carmas123
Copy link

This is solved by adding focusNode on TypeAheadField

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants