Skip to content

fix(forms): disable Reset button while submission is pending#398

Open
mekeke111 wants to merge 1 commit into
AnchorNet-Org:mainfrom
mekeke111:settlements-formreset-button
Open

fix(forms): disable Reset button while submission is pending#398
mekeke111 wants to merge 1 commit into
AnchorNet-Org:mainfrom
mekeke111:settlements-formreset-button

Conversation

@mekeke111

Copy link
Copy Markdown

Description

This change prevents users from resetting form fields while a submission request is still in progress by disabling the Reset button whenever the pending state is true.

Previously, both AnchorForm and SettlementForm disabled only the Submit button during asynchronous operations, leaving the Reset button active. This allowed users to clear the form and move focus back to the first input while the original request was still being processed. Once the pending request completed, the form could clear the fields again or display validation errors for inputs that the user had already modified, leading to confusing and inconsistent UI behavior.

Changes made:

  • Added disabled={pending} to the Reset button in src/components/AnchorForm.tsx.
  • Added disabled={pending} to the Reset button in src/components/SettlementForm.tsx.
  • Kept the existing Reset functionality unchanged when pending is false, including clearing form fields, resetting validation errors, and returning focus to the first input.
  • Preserved the existing Submit button behavior, which remains disabled while a request is in flight.

This update improves form-state consistency by preventing user interactions that could interfere with an active submission while maintaining the expected reset behavior once the request has completed.
closed #284

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.

AnchorForm's and SettlementForm's Reset button stays enabled while a submission is pending

1 participant