Skip to content

Commit 0ff495b

Browse files
fix: destructure decimal part in TokenAmountField isAllowed validator
The isAllowed callback was destructuring index 0 from split('.'), which is the integer part, not the decimal part. This caused the validation to compare token decimals against the integer digit count instead of the actual decimal digit count.
1 parent 3b21251 commit 0ff495b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • src/components/sharedComponents/TokenInput

src/components/sharedComponents/TokenInput/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ function TokenAmountField({
228228
const { onChange, inputRef, ...restProps } = renderInputProps
229229

230230
const isAllowed = ({ value }: NumberFormatValues) => {
231-
const [inputDecimals] = value.toString().split('.')
231+
const [, inputDecimals] = value.toString().split('.')
232232

233233
if (!inputDecimals) {
234234
return true

0 commit comments

Comments
 (0)