Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
nonDigitRegex.test(value) === true ? `${evaluatedValue}` : value
)
inputElementRef.current.value = formatSignificantFigures(
newValue,
significantFiguresCount
)
handleInput()
handleFocus()
return
}
if (event.ctrlKey === true || event.metaKey === true) {
return
}
if (isKeyCodeCharacterGenerating(event.keyCode) === true) {
const nextValue = computeNextValue(inputElementRef.current, event.key)
if (isValidNumericInput(nextValue, isInteger) === false) {
event.preventDefault()
return
}
const evaluatedValue = evaluateNumericExpression(nextValue)
if (evaluatedValue < minimum || evaluatedValue > maximum) {
event.preventDefault()
}
}
},
[
function (event) {
const nextValue = computeNextValue(
inputElementRef.current,
event.clipboardData.getData('Text')
)
if (isValidNumericInput(nextValue, isInteger) === false) {
event.preventDefault()
}
},
[isInteger]