Browse Source

fix(ui): Update compact select label when options change (#33890)

When the options change, the label needs to be updated as well.
Tony Xiao 2 years ago
parent
commit
1fc34a7673
1 changed files with 1 additions and 1 deletions
  1. 1 1
      static/app/components/forms/compactSelect.tsx

+ 1 - 1
static/app/components/forms/compactSelect.tsx

@@ -200,7 +200,7 @@ function CompactSelect<OptionType extends GeneralSelectValue = GeneralSelectValu
     const newValue = valueProp ?? internalValue;
     const newLabel = getLabel(newValue);
     setLabel(newLabel);
-  }, [valueProp ?? internalValue]);
+  }, [valueProp ?? internalValue, options]);
 
   // Calculate & update the trigger button's width, to be used as the
   // overlay's min-width