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] clearOnBlur is ignored #27813

Closed
wants to merge 1 commit into from
Closed

Conversation

denkigai
Copy link

@denkigai denkigai commented Aug 17, 2021

Currently input value is always cleared whenever focused is changed.
I thought clearOnBlur option works for this, but it doesn't.
https://github.com/mui-org/material-ui/blob/next/packages/material-ui-unstyled/src/AutocompleteUnstyled/useAutocomplete.d.ts#L73-L80

  /**
   * If `true`, the input's text is cleared on blur if no value is selected.
   *
   * Set to `true` if you want to help the user enter a new value.
   * Set to `false` if you want to help the user resume his search.
   * @default !props.freeSolo
   */
  clearOnBlur?: boolean;

The useAutocomplete should check the value of clearOnBlur option.

@mui-pr-bot
Copy link

mui-pr-bot commented Aug 17, 2021

Details of bundle changes (experimental)

Generated by 🚫 dangerJS against 9f7026f

@michaldudak
Copy link
Member

Could you add a test that would be failing before to verify and prove that your change does work?

@eps1lon eps1lon added bug 🐛 Something doesn't work component: autocomplete This is the name of the generic UI component, not the React module! PR: needs test The pull request can't be merged labels Aug 17, 2021
@ShirasawaSama
Copy link
Contributor

@michaldudak @eps1lon

Before:

k2avt-znfif

After:

itd7c-pgzow

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Sep 6, 2021
@eps1lon eps1lon self-assigned this Sep 14, 2021
@eps1lon eps1lon changed the base branch from next to master September 14, 2021 09:19
@eps1lon
Copy link
Member

eps1lon commented Sep 15, 2021

Looks like this was fixed in #28190 already. Please open a new issue and fill out the template if we missed something.

Sorry for leaving this unattended for so long.

@eps1lon eps1lon closed this Sep 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: autocomplete This is the name of the generic UI component, not the React module! PR: needs test The pull request can't be merged PR: out-of-date The pull request has merge conflicts and can't be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants