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]Fix Clear Value Issue #4241

Closed
wants to merge 1 commit into from

Conversation

ochowie
Copy link

@ochowie ochowie commented May 11, 2016

  • PR has tests / docs demo, and is linted.
  • Commit and PR titles begin with [ComponentName], and are in imperative form: "[Component] Fix leaky abstraction".
  • Description explains the issue / use-case resolved, and auto-closes the related issue(s) (http://tr.im/vFqem).

Removed setting the searchText state from the menu close function and
moved the newRequest event after the menu close so that it can be used
to overwrite the selected value.

P.S. Sorry for the dupes. Needed to change some details on the commit message and didn't want to rewrite history.

Closes #4213

Removed setting the searchText state from the menu close function and
moved the newRequest event after the menu close so that it can be used
to overwrite the selected value.
@mwildehahn
Copy link

+1 I have an autocomplete field that i use to populate a list of tokens. After you select a value, a token gets added, and I want the AutocompleteField to be empty so the user can add another value.

mwildehahn added a commit to lunohq/material-ui that referenced this pull request Jun 5, 2016
mwildehahn added a commit to lunohq/material-ui that referenced this pull request Jun 5, 2016
mwildehahn added a commit to lunohq/material-ui that referenced this pull request Jun 5, 2016
@phillipj
Copy link

phillipj commented Jul 6, 2016

@oliviertassinari @mbrookes any thoughts on this by any chance?

I'm struggling with the same thing, wanting to clear the displayed value after the user has selected a value from the suggested list of values.. Not seeing any plausible way around this as is, as the selected value overrides what I'm trying to set to searchText in a onNewRequest callback.

@oliviertassinari
Copy link
Member

@ochowie Thanks for proposing this fix. I'm have merged an alternative solution with the needed unit tests.

@zannager zannager added the component: autocomplete This is the name of the generic UI component, not the React module! label Mar 14, 2023
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

Successfully merging this pull request may close these issues.

[Auto Complete] Clear value issue
6 participants