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

Autofocus a ReactiveDropdownField #463

Open
AdrienLemaire opened this issue Sep 13, 2024 · 1 comment
Open

Autofocus a ReactiveDropdownField #463

AdrienLemaire opened this issue Sep 13, 2024 · 1 comment
Labels
question Further information is requested

Comments

@AdrienLemaire
Copy link

Environment

Package version:
17.0.1

Describe your question

How can I get a dropdown list to show up by default when landing on a form ?

@AdrienLemaire AdrienLemaire added the question Further information is requested label Sep 13, 2024
@UsamaKarim
Copy link

I tried and it doesn't seems to be working for me.

Here's my implementation

onEditingComplete: (_) {
    final control = form.control('account_type')
        as FormControl<AccountType>;
    final focusNode = control.focusController?.focusNode;
    final fnContext = focusNode?.context;
    if (fnContext != null) {
      focusNode?.requestFocus();
      Scrollable.ensureVisible(fnContext);
    }
  },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants