Skip to content

fix(media): release the upload action when the file picker closes - #541

Merged
larbish merged 1 commit into
nuxt-content:mainfrom
MatthieuVillebrun:fix/media-upload-picker-cancel
Aug 18, 2026
Merged

fix(media): release the upload action when the file picker closes#541
larbish merged 1 commit into
nuxt-content:mainfrom
MatthieuVillebrun:fix/media-upload-picker-cancel

Conversation

@MatthieuVillebrun

Copy link
Copy Markdown
Contributor

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

ItemActionsToolbar opens the picker indirectly: the button sets context.actionInProgress, and a watcher reacts by clicking a hidden <input type="file">. Reopening therefore requires that state to go back to null first.

UploadMedia is in neither oneStepActions nor twoStepActions (utils/context.ts:3-4), so the re-entrancy guard in useContext.ts:83-95 turns any second dispatch into a bare return while 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 @cancel on the input (mirroring ItemCardForm's dismissal paths).

@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@MatthieuVillebrun is attempting to deploy a commit to the Nuxt Team on Vercel.

A member of the Team first needs to authorize it.

@pkg-pr-new

pkg-pr-new Bot commented Aug 17, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/nuxt-studio@541

commit: bdd5c2c

@larbish larbish left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks ❤️

@larbish
larbish force-pushed the fix/media-upload-picker-cancel branch from bdd5c2c to 12dfdf6 Compare August 18, 2026 08:29
@larbish
larbish merged commit 4ad666e into nuxt-content:main Aug 18, 2026
1 of 3 checks passed
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.

Media upload button stops working after the file picker is closed

2 participants