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

SimpleFormIterator with ReferenceInput and AutocompleteInput clears selected value on item selection #10333

Open
StephanieIlievaa opened this issue Nov 6, 2024 · 1 comment

Comments

@StephanieIlievaa
Copy link

When using SimpleFormIterator with ArrayInput, ReferenceInput, and AutocompleteInput in React Admin, selecting an item from the AutocompleteInput dropdown temporarily displays the selected item but then clears it unexpectedly. This issue makes it difficult to keep the selected value in the input field.

This issue appears to occur specifically within SimpleFormIterator, as ReferenceInput and AutocompleteInput work as expected outside of SimpleFormIterator.

Steps to Reproduce
Create a form component using ArrayInput, SimpleFormIterator, ReferenceInput, and AutocompleteInput, similar to the following setup:

Frontend:
Image

Expected Behavior
The selected company should remain in the input field, allowing the user to see the chosen item until they either submit the form or make a new selection.
Actual Behavior
Upon selecting a company, the AutocompleteInput momentarily displays the selected company but then re-renders, clearing the selected value from the input field.

Environment
React Admin version: "^4.16.12"
React version: "^18.2.0"
Browser: Chrome 130.0.6723.92 (Official Build)

@djhi
Copy link
Collaborator

djhi commented Nov 7, 2024

Thanks for reporting this. Please provide a sample application showing the issue, preferably a sandbox forked from

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

No branches or pull requests

2 participants