Numeric range tweaks (#1445)
* tweaks to help with layout for numeric ranges * use negative infinity for min * remove some debug code --------- Co-authored-by: jasquat <jasquat@users.noreply.github.com>
This commit is contained in:
parent
ae502e50d7
commit
f773823008
|
@ -262,9 +262,7 @@ export default function CustomForm({
|
|||
(formDataToCheck[propertyKey].min === undefined ||
|
||||
formDataToCheck[propertyKey].max === undefined)
|
||||
) {
|
||||
errors[propertyKey].addError(
|
||||
`must have valid Minimum and Maximum on ${propertyKey}`
|
||||
);
|
||||
errors[propertyKey].addError('must have valid Minimum and Maximum');
|
||||
}
|
||||
if (
|
||||
formDataToCheck[propertyKey].min <
|
||||
|
|
|
@ -117,17 +117,19 @@ export default function NumericRangeField({
|
|||
};
|
||||
|
||||
let minHelperText = '';
|
||||
if (minNumber !== undefined) {
|
||||
minHelperText = `Min: ${formatNumberString(minNumber?.toString() || '')}`;
|
||||
}
|
||||
let maxHelperText = '';
|
||||
if (maxNumber !== undefined) {
|
||||
maxHelperText = `Max: ${formatNumberString(maxNumber?.toString() || '')}`;
|
||||
if (minNumber !== undefined || maxNumber !== undefined) {
|
||||
minHelperText = `Min: ${
|
||||
formatNumberString(minNumber?.toString() || '') || '-∞'
|
||||
}`;
|
||||
maxHelperText = `Max: ${
|
||||
formatNumberString(maxNumber?.toString() || '') || '∞'
|
||||
}`;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="numeric--range-field-wrapper">
|
||||
<div className="numeric--range-field-label">
|
||||
<div>
|
||||
<h5>
|
||||
{required
|
||||
? commonAttributes.labelWithRequiredIndicator
|
||||
|
|
Loading…
Reference in New Issue