Skip to content

[Autocomplete] onInputChange it's fired in wrong moments #18568

@sclavijo93

Description

@sclavijo93

I don't know if I'm not understanding how it works or it's a bug, but onInputChange is executed when the component is mounted and when the TextField loses the focus.

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

onInputChange is been fired when the component is mounted and when the TextField loses the focus.

Expected Behavior 🤔

onInputChange has to be fired only when the TextField has really fired

Steps to Reproduce 🕹

Steps:

  1. codesandbox.io reproduction
  2. The alert shows up when the page is fully loaded.
  3. Click on the TextField and then click outside.
  4. The alert shows up again.

Your Environment 🌎

Tech Version
Material-UI v4.7.0
React v16.10.2
Browser Chrome v78.0.3904.108 (64 bits)

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGreat for first contributions. Enable to learn the contribution process.scope: autocompleteChanges related to the autocomplete. This includes ComboBox.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions