fix/292-reset-amount-on-tab-switch - #411
Conversation
…ure vitest environment
|
@extolkom Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
Hi @Junirezz 👋 frontend/src/components/VaultDashboard.test.tsx — rewrote tests for the tab-switch reset behavior The failing checks relate to errors in VaultDashboard.tsx, Portfolio.tsx, vaultApi.ts, cypress.config.ts, and SessionExpiryWarning.test.tsx — none of which are files I modified. |
Closes #292
Summary
Fixed a UX bug where the amount field and validation errors were not reset when switching between Deposit and Withdraw tabs in VaultDashboard.tsx.
Changes
Added setAmount("") and setTouched(INITIAL_TOUCHED_STATE) to the onValueChange callback on the Tabs component (line ~460)
Before
Typing 500 in Deposit tab then switching to Withdraw would show the same value and any validation errors immediately, before the user had interacted with the Withdraw tab.
After
Switching tabs clears the amount field and resets touched state so no stale errors are shown