From 53854769eee2816d851f09ba78a08adc09ae9e64 Mon Sep 17 00:00:00 2001 From: melohagan <101575380+melohagan@users.noreply.github.com> Date: Tue, 29 Oct 2024 12:31:31 +0000 Subject: [PATCH] Fix relationship field filter on change (#14879) Co-authored-by: Conor Webb <126772285+ConorWebb96@users.noreply.github.com> --- .../client/src/components/app/forms/RelationshipField.svelte | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/client/src/components/app/forms/RelationshipField.svelte b/packages/client/src/components/app/forms/RelationshipField.svelte index a6d0564f7f..1439902b26 100644 --- a/packages/client/src/components/app/forms/RelationshipField.svelte +++ b/packages/client/src/components/app/forms/RelationshipField.svelte @@ -113,7 +113,10 @@ $: debouncedFetchRows(searchTerm, primaryDisplay, defaultValue) const forceFetchRows = async () => { + // if the filter has changed, then we need to reset the options, clear the selection, and re-fetch + optionsObj = {} fieldApi?.setValue([]) + selectedValue = [] debouncedFetchRows(searchTerm, primaryDisplay, defaultValue) } const fetchRows = async (searchTerm, primaryDisplay, defaultVal) => {