From c0b102c304afb340145b5e7ba366972ee08e7875 Mon Sep 17 00:00:00 2001 From: jinchung Date: Tue, 17 Sep 2024 10:16:30 -0400 Subject: [PATCH] Fix: check for native placeholder value while checking native input decimal places --- src/__swaps__/screens/Swap/components/SwapNumberPad.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/__swaps__/screens/Swap/components/SwapNumberPad.tsx b/src/__swaps__/screens/Swap/components/SwapNumberPad.tsx index 85506a2f31e..b9b9a5286a4 100644 --- a/src/__swaps__/screens/Swap/components/SwapNumberPad.tsx +++ b/src/__swaps__/screens/Swap/components/SwapNumberPad.tsx @@ -93,10 +93,13 @@ export const SwapNumberPad = () => { const currentValueDecimals = currentValue.split('.')?.[1]?.length ?? -1; const nativeCurrencyDecimals = supportedNativeCurrencies[nativeCurrency].decimals; + const isNativePlaceholderValue = equalWorklet(currentValue, 0) && SwapInputController.inputMethod.value !== focusedInput.value; + if (addingDecimal && nativeCurrencyDecimals === 0) { return true; } else if ( (focusedInput.value === 'inputNativeValue' || focusedInput.value === 'outputNativeValue') && + !isNativePlaceholderValue && currentValueDecimals >= nativeCurrencyDecimals ) { return true;