Skip to content

Don't reset submit button loading state right before nav - #3345

Open
david-crespo wants to merge 2 commits into
mainfrom
form-loading-success
Open

Don't reset submit button loading state right before nav#3345
david-crespo wants to merge 2 commits into
mainfrom
form-loading-success

Conversation

@david-crespo

@david-crespo david-crespo commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Noticed while doing #3344. Form submit button loading state is true only when the mutation isPending. But there's a brief moment after the mutation completes but before the success nav happens where that's false and the button is on screen. What that looks like is the button flipping back to clickable right before the nav. That's stupid, so I gave every button where it makes sense loading={isPending || isSuccess}. There's some risk we could have a form where that is not appropriate (and there are a couple already — see createNic on the instance networking tab) but it's very easy for agents to get it right. I added a note to AGENTS.md about it.

Before

2026-08-21-project-submit-loading.mp4

After

2026-08-21-project-submit-loading-fixed.mp4

@vercel

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
console Ready Ready Preview Aug 21, 2026 10:13pm

Request Review

onDismiss={() => {
setCreateModalOpen(false)
createNic.reset() // clear stale error state
}}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lack of reset() here was a bug, uncaught in a previous PR where I tried to fix these missing resets.

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