Skip to content

Commit 07174c8

Browse files
committed
Sort Input Type dropdown
1 parent e4fbdc3 commit 07174c8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/formBuilder/CardGeneralParameterInputs.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ export default function CardGeneralParameterInputs({
6363
// Exclude hidden inputs based on mods
6464
if (mods) inputKeys = subtractArray(inputKeys, mods.deactivatedFormInputs);
6565

66-
return inputKeys.map((key) => ({ value: key, label: categoryMap[key] }));
66+
return inputKeys
67+
.map((key) => ({ value: key, label: categoryMap[key] }))
68+
.sort((a, b) => a.label.localeCompare(b.label));
6769
};
6870

6971
return (
@@ -186,7 +188,7 @@ export default function CardGeneralParameterInputs({
186188
value: parameters.category,
187189
label: categoryMap[parameters.category],
188190
}}
189-
placeholder='Category'
191+
placeholder={inputTypeLabel}
190192
options={availableInputTypes()}
191193
onChange={(val: any) => {
192194
// figure out the new 'type'

0 commit comments

Comments
 (0)