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].min === undefined ||
|
||||||
formDataToCheck[propertyKey].max === undefined)
|
formDataToCheck[propertyKey].max === undefined)
|
||||||
) {
|
) {
|
||||||
errors[propertyKey].addError(
|
errors[propertyKey].addError('must have valid Minimum and Maximum');
|
||||||
`must have valid Minimum and Maximum on ${propertyKey}`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
formDataToCheck[propertyKey].min <
|
formDataToCheck[propertyKey].min <
|
||||||
|
|
|
@ -117,17 +117,19 @@ export default function NumericRangeField({
|
||||||
};
|
};
|
||||||
|
|
||||||
let minHelperText = '';
|
let minHelperText = '';
|
||||||
if (minNumber !== undefined) {
|
|
||||||
minHelperText = `Min: ${formatNumberString(minNumber?.toString() || '')}`;
|
|
||||||
}
|
|
||||||
let maxHelperText = '';
|
let maxHelperText = '';
|
||||||
if (maxNumber !== undefined) {
|
if (minNumber !== undefined || maxNumber !== undefined) {
|
||||||
maxHelperText = `Max: ${formatNumberString(maxNumber?.toString() || '')}`;
|
minHelperText = `Min: ${
|
||||||
|
formatNumberString(minNumber?.toString() || '') || '-∞'
|
||||||
|
}`;
|
||||||
|
maxHelperText = `Max: ${
|
||||||
|
formatNumberString(maxNumber?.toString() || '') || '∞'
|
||||||
|
}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="numeric--range-field-wrapper">
|
<div className="numeric--range-field-wrapper">
|
||||||
<div className="numeric--range-field-label">
|
<div>
|
||||||
<h5>
|
<h5>
|
||||||
{required
|
{required
|
||||||
? commonAttributes.labelWithRequiredIndicator
|
? commonAttributes.labelWithRequiredIndicator
|
||||||
|
|
Loading…
Reference in New Issue