Skip to content

DropDownTextField selecting item from the list doesn't update the controller or the value #6

@JohnGalt1717

Description

@JohnGalt1717

Given the following:

DropdownTextField<String>(
                        controller: viewModel.person.salutation,
                        decoration: InputDecoration(
                          labelText: LocaleKeys.salutation.tr(),
                        ),
                        onSubmit: (value) =>
                            viewModel.person.salutation.text = value,
                        list: [
                          DropdownItem(
                            value: LocaleKeys.notSpecified.tr(),
                            id: "",
                          ),
                          DropdownItem(
                            value: LocaleKeys.mrs.tr(),
                            id: LocaleKeys.mrs.tr(),
                          ),
                          DropdownItem(
                            value: LocaleKeys.ms.tr(),
                            id: LocaleKeys.ms.tr(),
                          ),
                          DropdownItem(
                            value: LocaleKeys.miss.tr(),
                            id: LocaleKeys.miss.tr(),
                          ),
                          DropdownItem(
                            value: LocaleKeys.mister.tr(),
                            id: LocaleKeys.mister.tr(),
                          ),
                          DropdownItem(
                            value: LocaleKeys.master.tr(),
                            id: LocaleKeys.master.tr(),
                          ),
                        ],
                      )

If you click on the completions and pick say Mr., it doesn't update the controller, the onSubmit and onSuggestionTap don't fire.

It isn't clear based on the documentation nor the sample how to make this work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions