Skip to content

Commit

Permalink
Fix: check for native placeholder value while checking native input d…
Browse files Browse the repository at this point in the history
…ecimal places
  • Loading branch information
jinchung committed Sep 17, 2024
1 parent 5b8eaaf commit b466d76
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/__swaps__/screens/Swap/components/SwapNumberPad.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b466d76

Please sign in to comment.