Skip to content

Commit

Permalink
[MIRROR] Fixes dropdown displaytext not working for numeric values (#…
Browse files Browse the repository at this point in the history
…2112)

* Fixes dropdown displaytext not working for numeric values

* Update dropdowns.tsx

---------

Co-authored-by: Bloop <[email protected]>
  • Loading branch information
2 people authored and StealsThePRs committed Apr 22, 2024
1 parent ae5d496 commit 36cb13f
Showing 1 changed file with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,17 @@ export function FeatureDropdownInput(props: DropdownInputProps) {
};
});

let display_text = value;
if (display_names) {
display_text = display_names[value];
}

return (
<Dropdown
buttons={buttons}
disabled={disabled}
onSelected={handleSetValue}
// NOVA EDIT CHANGE - ORIGINAL: displayText={value && capitalizeFirst(value)}
displayText={
display_names
? display_names[value] && capitalizeFirst(display_names[value])
: value && capitalizeFirst(value)
}
// NOVA EDIT CHANGE END
displayText={capitalizeFirst(display_text)}
options={dropdownOptions}
selected={value}
width="100%"
Expand Down Expand Up @@ -96,16 +95,15 @@ export function FeatureIconnedDropdownInput(props: IconnedDropdownInputProps) {
};
});

let display_text = value;
if (display_names) {
display_text = display_names[value];
}

return (
<Dropdown
buttons
// NOVA EDIT CHANGE - ORIGINAL: displayText={value && capitalizeFirst(value)}
displayText={
display_names
? display_names[value] && capitalizeFirst(display_names[value])
: value && capitalizeFirst(value)
}
// NOVA EDIT CHANGE END
displayText={capitalizeFirst(display_text)}
onSelected={handleSetValue}
options={dropdownOptions}
selected={value}
Expand Down

0 comments on commit 36cb13f

Please sign in to comment.