diff --git a/src/Components/Form/FormFields/RangeAutocompleteFormField.tsx b/src/Components/Form/FormFields/RangeAutocompleteFormField.tsx index 41f98c02471..8feebe651b0 100644 --- a/src/Components/Form/FormFields/RangeAutocompleteFormField.tsx +++ b/src/Components/Form/FormFields/RangeAutocompleteFormField.tsx @@ -26,7 +26,8 @@ export default function RangeAutocompleteFormField(props: Props) { const sortedThresholds = props.thresholds?.sort(compareBy("value")) || []; const getThreshold = (value: number) => { - const threshold = sortedThresholds.findLast( + const reversedThresholds = [...sortedThresholds].reverse(); + const threshold = reversedThresholds.find( (threshold) => value >= threshold.value, ); return threshold;