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 ReferenceArrayInput list when filter is changed #4494

Merged
merged 8 commits into from
Mar 12, 2020

Conversation

JulienMattiussi
Copy link
Contributor

@JulienMattiussi JulienMattiussi commented Mar 9, 2020

Closes #4466

Issue

When you change the filter of a ReferenceArrayInput and reset its selected value using useForm hook, the previous selected value is always proposed in the list.

Solution

Limit ReferenceArrayInput proposed list to:

  • effectively selected values
  • matching values

Screenshot

referenceFilter

@JulienMattiussi JulienMattiussi added the WIP Work In Progress label Mar 9, 2020
@JulienMattiussi JulienMattiussi changed the title Fix ReferenceArrayInput list when selected value is changed Fix ReferenceArrayInput list when filter is changed Mar 9, 2020
@JulienMattiussi JulienMattiussi added RFR Ready For Review and removed WIP Work In Progress labels Mar 9, 2020
@JulienMattiussi JulienMattiussi added WIP Work In Progress and removed RFR Ready For Review labels Mar 11, 2020
@JulienMattiussi JulienMattiussi added RFR Ready For Review and removed WIP Work In Progress labels Mar 11, 2020
@Hemant-yadav
Copy link
Contributor

Hemant-yadav commented Mar 11, 2020

Hi,

Even on ReferenceInput changing the filter doesn't correctly updates the filters.
It persists the original filters. I forked the Sandbox

With SelectInput it still works correctly but with AutocompleteInput it doesn't.

Would you please look on #4508 which references this issue. LGTM tho

@JulienMattiussi
Copy link
Contributor Author

You're right about ReferenceInput
We'll try to check this issue soon #4507.

By the way, there is no technical relation between this RefenceArrayInput fix and the needed ReferenceInput fix. Both their behaviour and issues are different.

@fzaninotto fzaninotto merged commit aaeff7f into master Mar 12, 2020
@fzaninotto fzaninotto deleted the reference-array-input-selected-value branch March 12, 2020 11:14
@fzaninotto fzaninotto added this to the 3.3.1 milestone Mar 12, 2020
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.

Changing the value to null and setting filter on a ReferenceArrayInput does not filter choices properly
3 participants