From 470b57316a3bee08f924ed4e6d8b42c646c0722f Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sat, 10 Dec 2022 16:04:06 -0800 Subject: [PATCH] Add type number to value prop in HintedSelectInputSelectedValue (cherry picked from commit fea66cb7bccc7e94523614db38b157fa38f55ea5) --- .../Form/HintedSelectInputSelectedValue.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/frontend/src/Components/Form/HintedSelectInputSelectedValue.js b/frontend/src/Components/Form/HintedSelectInputSelectedValue.js index 07f6c9e25..a3fecf324 100644 --- a/frontend/src/Components/Form/HintedSelectInputSelectedValue.js +++ b/frontend/src/Components/Form/HintedSelectInputSelectedValue.js @@ -24,7 +24,7 @@ function HintedSelectInputSelectedValue(props) { >
{ - isMultiSelect && + isMultiSelect ? value.map((key, index) => { const v = valuesMap[key]; return ( @@ -32,26 +32,28 @@ function HintedSelectInputSelectedValue(props) { {v ? v.value : key} ); - }) + }) : + null } { - !isMultiSelect && value + isMultiSelect ? null : value }
{ - hint != null && includeHint && + hint != null && includeHint ?
{hint} -
+ : + null } ); } HintedSelectInputSelectedValue.propTypes = { - value: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))]).isRequired, + value: PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))]).isRequired, values: PropTypes.arrayOf(PropTypes.object).isRequired, hint: PropTypes.string, isMultiSelect: PropTypes.bool.isRequired,