Skip to content

Ability to turn of FAutocomplete at a runtime #1034

Description

@chris-rutkowski

While FAutocomplete is great I need an ability to disable in a runtime both:

  • suggestion list popover
  • typeahead (placeholder autocompleting the first item)

E.g. scenarios:

  • user presses ignore suggestions button
  • selection from autocompletion is allowed to be triggered only once (especially after this issue Add onSelect callback to FAutocomplete #1033 where the autocompletion scope can be bigger)
  • autocompletion enabled only in the form for "adding new item", but not for "editing existing one"

I'd like the FAutocomplete or FAutocompleteController to expose a boolean/method to disable these features and literally convert to ordinary text field. When disabled, if popover or typeahead are currently displayed, popover disappears, and so does typeahead.

Please note1: FAutocomplete contains property enableSuggestions but it is for something very different.

Please note2: I tried to cook some rudimentary solution for this, but it was glitching. Options I tried were:

  • having my own suggestionEnabled prop, calling setState and returning empty list from filter and contentBuilder, but those two are not triggered when user inputs stays the same
  • for above solution I tried to add a key, FAutocomplete(key: ValueKey('autocomplete_$suggestionEnabled')), but it was causing exceptions saying that notifiers are used after being disposed in various scenarios.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Icebox

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions