@sustaina/shared-ui 1.29.1 → 1.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -2686,6 +2686,16 @@ var LookupSelect = ({
2686
2686
  }
2687
2687
  };
2688
2688
  }, [inputValue, fetchSuggestions, suggestionDebounce, upsertOptionLabels]);
2689
+ useEffect(() => {
2690
+ if (!fetchSuggestions) return;
2691
+ if (value.length === 0) return;
2692
+ const unresolvedValues = value.filter((v) => !optionLabels[v]);
2693
+ if (unresolvedValues.length === 0) return;
2694
+ fetchSuggestions("").then((options) => {
2695
+ upsertOptionLabels(options);
2696
+ }).catch(() => {
2697
+ });
2698
+ }, [value, fetchSuggestions, optionLabels, upsertOptionLabels]);
2689
2699
  useEffect(() => {
2690
2700
  const handleDocumentClick = (event) => {
2691
2701
  const target = event.target;