fix(forms): disable Reset button while submission is pending#398
Open
mekeke111 wants to merge 1 commit into
Open
fix(forms): disable Reset button while submission is pending#398mekeke111 wants to merge 1 commit into
mekeke111 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
disabled={pending}to the Reset button insrc/components/AnchorForm.tsx.disabled={pending}to the Reset button insrc/components/SettlementForm.tsx.pendingis false, including clearing form fields, resetting validation errors, and returning focus to the first input.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