Skip to content

Commit

Permalink
add sort func to initial page
Browse files Browse the repository at this point in the history
  • Loading branch information
cretadn22 committed Aug 4, 2024
1 parent e41cb67 commit 07c12e6
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, {useMemo} from 'react';
import SelectionList from '@components/SelectionList';
import RadioListItem from '@components/SelectionList/RadioListItem';
import localeCompare from '@libs/LocaleCompare';

type ReportFieldsInitialListValuePickerProps = {
/** Options to select from if field is of type list */
Expand All @@ -22,6 +23,7 @@ function ReportFieldsInitialListValuePicker({listValues, disabledOptions, value,
{
data: Object.values(listValues ?? {})
.filter((listValue, index) => !disabledOptions[index])
.sort((a, b) => localeCompare(a, b))
.map((listValue) => ({
keyForList: listValue,
value: listValue,
Expand Down

0 comments on commit 07c12e6

Please sign in to comment.