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

[AutoComplete] onNewRequest doesn't trigger when searchText is empty #6702

Closed
dispix opened this issue Apr 25, 2017 · 2 comments
Closed

[AutoComplete] onNewRequest doesn't trigger when searchText is empty #6702

dispix opened this issue Apr 25, 2017 · 2 comments
Labels
component: autocomplete This is the name of the generic UI component, not the React module!

Comments

@dispix
Copy link
Contributor

dispix commented Apr 25, 2017

Problem description

As described in the title, if searchText === '', pressing Enter in the text field doesn't call onNewRequest. This is rather problematic as many use cases include clearing the search if the user deletes the whole search value and submit.

Link to minimal working code that reproduces the issue

<AutoComplete
  floatingLabelText="Search"
  searchText={searchInput}
  onUpdateInput={updateSearch}
  onNewRequest={console.log} // Does not trigger when the value of searchText is ''
  dataSource={[]}
/>

Versions

  • Material-UI: ^0.17.1,
  • React: 15.4.1
  • Browser: Chrome Version 57.0.2987.133 (64-bit) (OS X)
@ErreMalote
Copy link

ErreMalote commented Apr 25, 2017

#6659 "openOnFocus" from the AutoComplete is defective

this is related to this issue as well.

@oliviertassinari
Copy link
Member

Closed by #4783

@oliviertassinari oliviertassinari added the component: autocomplete This is the name of the generic UI component, not the React module! label Apr 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: autocomplete This is the name of the generic UI component, not the React module!
Projects
None yet
Development

No branches or pull requests

3 participants