New source found from dndbeyond.com
This commit is contained in:
@@ -79,12 +79,20 @@ export const InputField: FC<InputFieldProps> = ({
|
||||
const intValue = parseInt(e.target.value);
|
||||
|
||||
// If entered value is below the minimum, reset to minimum
|
||||
if (!isNaN(intValue) && inputProps?.min && intValue < inputProps?.min) {
|
||||
if (
|
||||
!isNaN(intValue) &&
|
||||
inputProps?.min !== undefined &&
|
||||
intValue < inputProps.min
|
||||
) {
|
||||
setValue(inputProps.min);
|
||||
}
|
||||
|
||||
// If entered value is above the maximum and no initialValue exists, reset to maximum
|
||||
if (!isNaN(intValue) && inputProps?.max && intValue > inputProps?.max) {
|
||||
if (
|
||||
!isNaN(intValue) &&
|
||||
inputProps?.max !== undefined &&
|
||||
intValue > inputProps.max
|
||||
) {
|
||||
setValue(inputProps.max);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user