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

Fix AutocompleteInput when record has a different shape between getList and getMany #8687

Merged
merged 3 commits into from
Mar 2, 2023

Conversation

slax57
Copy link
Contributor

@slax57 slax57 commented Mar 1, 2023

Issue

AutocompleteInput uses getMany to fetch the records matching the already selected choices, and getList to fetch the other available choices.

If both methods do not render exactly the same record shape (e.g. if getMany records have extra fields compared to getList records), then when fetching for additional choices (e.g. while filtering), AutocompleteInput gets confused because it thinks the selected choice has changed, and ends up resetting the filterValue.

Solution

Instead of comparing the full records, only compare their id (or the field chosen as optionValue)

@slax57 slax57 added the RFR Ready For Review label Mar 1, 2023
@djhi djhi added this to the 4.8.2 milestone Mar 2, 2023
@djhi djhi merged commit 7e9db44 into master Mar 2, 2023
@djhi djhi deleted the fix-AutocompleteInput-Different-Shape-In-GetMany branch March 2, 2023 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants