Skip to content

fix: farm balance send input resetting to 0 on every keystroke#414

Merged
fr1jo merged 2 commits intomainfrom
fix/farm-balance-send-input
Feb 19, 2026
Merged

fix: farm balance send input resetting to 0 on every keystroke#414
fr1jo merged 2 commits intomainfrom
fix/farm-balance-send-input

Conversation

@fr1jo
Copy link
Contributor

@fr1jo fr1jo commented Feb 19, 2026

Summary

  • Fixed bug where users couldn't type amounts in the Farm Balance send flow
  • The input would immediately reset to "0" after any keystroke

Root Cause

The ComboInputField component had a useEffect that resets the amount when the token changes, but setAmount was incorrectly included in the dependency array. Since StepOne.tsx passes handleAmountChange(index) which creates a new function reference on every render, this caused the reset effect to fire constantly.

Changes

  • Removed setAmount from the useEffect dependency array in ComboInputField.tsx
  • Added biome-ignore comment explaining why the dependency is intentionally excluded

Test plan

  • Navigate to /transfer/farmbalance
  • Verify you can type amounts in the input field
  • Verify the "Max" button still works
  • Verify changing tokens still resets the amount properly
  • Test both single token and multi-token transfer scenarios

🤖 Generated with Claude Code

The useEffect that resets the amount when the token changes had
setAmount in its dependency array. Since the parent component passes
a new function reference on every render (via handleAmountChange(index)),
this caused the reset effect to fire constantly, making the input unusable.

Removed setAmount from the dependency array since the effect should
only run when selectedToken actually changes.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@netlify
Copy link

netlify bot commented Feb 19, 2026

Deploy Preview for pintomoney ready!

Name Link
🔨 Latest commit e578413
🔍 Latest deploy log https://app.netlify.com/projects/pintomoney/deploys/6997993f20365d000842f9ea
😎 Deploy Preview https://deploy-preview-414.preview.pinto.money
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@fr1jo fr1jo merged commit 812207d into main Feb 19, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant