Skip to content

Support empty string as valid value on AutoComplete component #21206

@blitzbohne

Description

@blitzbohne

Currently the problem is that the AutoComplete throws a warning if none of the options is matched due this pull request:

#20235

However it is now impossible to set an empty value aka "cleared" status on an AutoComplete as it always throws this warning which lets you go crazy with many AutoCompletes.

However providing a null value obviously transforms the component into an uncontrolled input and throws the React Error so one has no choice as of now except adding an empty option to the options list which makes no sense.

  • I have searched the issues of this repository and believe that this is not a duplicate.

Summary 💡

I'd strongly advise to either revert this pull request: #20235 OR at least extend it to also check and allow for empty string if the Auto-Complete component is clearable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope: autocompleteChanges related to the autocomplete. This includes ComboBox.support: Stack OverflowPlease ask the community on Stack Overflow.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions