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

Improper input value selection process for Autocomplete/ReferenceInput combo #8096

Closed
ZachSelindh opened this issue Aug 23, 2022 · 3 comments · Fixed by #8123
Closed

Improper input value selection process for Autocomplete/ReferenceInput combo #8096

ZachSelindh opened this issue Aug 23, 2022 · 3 comments · Fixed by #8123
Labels

Comments

@ZachSelindh
Copy link
Contributor

What you were expecting:
Consistent behavior from AutocompleteInputs as children of ReferenceInputs.

What happened instead:
The AutocompleteInput will save incomplete text inputs without having made a dropdown selection.

The ReferenceInput does not seem to be making the appropriate calls when given the prop "enableGetChoices"

Steps to reproduce:
Add an AutocompleteInput with common props such as filterToQuery and shouldRenderSuggestions as a child of a ReferenceInput with common props such as enableGetChoices.

Related code:
https://codesandbox.io/s/ecstatic-ptolemy-64jbky?file=/src/posts/PostCreate.tsx

Environment

  • React-admin version: 4.3.0
  • Last version that did not exhibit the issue (if applicable): 4.2.7
  • React version: 17
  • Browser: Chrome
@WiXSL
Copy link
Contributor

WiXSL commented Aug 30, 2022

I don't understand your issue.
Could you be more schematic about how to reproduce the issue, and what is the intended behavior?
Thanks.

@ZachSelindh
Copy link
Contributor Author

ZachSelindh commented Aug 30, 2022

@WiXSL Absolutely. Essentially, a ReferenceInput/AutocompleteInput used to require to user to select one of the matching choices in the dropdown list. Now, the entered text persists whether a choice has been made or not, which is confusing and will lead to users believing they have made a choice when they have not.

@WiXSL
Copy link
Contributor

WiXSL commented Aug 31, 2022

It seems like a bug. I'm marking it as such.
Let me see what I can find since by default, the AutocompleteInput has the MUI's clearOnBlur prop set to true, but it doesn't seem to be working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants