fix(media): release the upload action when the file picker closes - #541
Merged
larbish merged 1 commit intoAug 18, 2026
Merged
Conversation
Contributor
|
@MatthieuVillebrun is attempting to deploy a commit to the Nuxt Team on Vercel. A member of the Team first needs to authorize it. |
commit: |
larbish
force-pushed
the
fix/media-upload-picker-cancel
branch
from
August 18, 2026 08:29
bdd5c2c to
12dfdf6
Compare
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.
What breaks
Fixes #540
Clicking Upload media, then dismissing the OS file picker, permanently disables the button. The picker never reopens until the page is reloaded. The same happens after a successful upload.
Why
ItemActionsToolbaropens the picker indirectly: the button setscontext.actionInProgress, and a watcher reacts by clicking a hidden<input type="file">. Reopening therefore requires that state to go back tonullfirst.UploadMediais in neitheroneStepActionsnortwoStepActions(utils/context.ts:3-4), so the re-entrancy guard inuseContext.ts:83-95turns any second dispatch into a barereturnwhile the action is still marked in progress. And nothing marks it finished:What the fix does: releases the action at both terminal outcomes, each where the codebase already does that:
unsetActionInProgress()at the end of the raw handler (matching the two Create handlers), and@cancelon the input (mirroringItemCardForm's dismissal paths).