Skip to content

Fix: Upload error notices don't appear when repeatedly selecting the same oversized file#74643

Open
Swanand01 wants to merge 5 commits intoWordPress:trunkfrom
Swanand01:fix/upload-notice-not-reappearing
Open

Fix: Upload error notices don't appear when repeatedly selecting the same oversized file#74643
Swanand01 wants to merge 5 commits intoWordPress:trunkfrom
Swanand01:fix/upload-notice-not-reappearing

Conversation

@Swanand01
Copy link
Contributor

What?

Closes #74533

Why?

When a user attempts to upload an oversized file that triggers a validation error, the error notice only appears on the first upload attempt. If the user clicks the upload button again and selects the same file, no error notice is shown, even though the file still exceeds size limits.

How?

This PR adds onClick handlers to reset the input value before file selection across all upload components.

Testing Instructions

  1. Navigate to a block that supports file uploads (Image, Video, Audio, Gallery, Media & Text, or File block)
  2. Click the "Upload" button
  3. Select a file that exceeds the upload size limit
  4. Observe the error notice appears (e.g., "This file exceeds the maximum upload size for this site")
  5. Click the "Upload" button again
  6. Select the same oversized file
  7. Error notice should appear

@github-actions github-actions bot added [Package] Block library /packages/block-library [Package] Block editor /packages/block-editor labels Jan 15, 2026
@github-actions
Copy link

github-actions bot commented Jan 15, 2026

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Swanand01 <swanandm@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Jan 15, 2026
@github-actions
Copy link

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @Swanand01! In case you missed it, we'd love to have you join us in our Slack community.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@Swanand01 Swanand01 marked this pull request as draft January 15, 2026 06:22
@hbhalodia hbhalodia changed the title Fix/upload notice not reappearing Fix: Upload error notices don't appear when repeatedly selecting the same oversized file Jan 15, 2026
@github-actions github-actions bot added the [Package] Media Utils /packages/media-utils label Jan 19, 2026
@Swanand01 Swanand01 marked this pull request as ready for review January 20, 2026 05:13
@amitraj2203 amitraj2203 added the [Type] Bug An existing feature does not function as intended label Jan 20, 2026
@Mamaduka Mamaduka self-requested a review January 20, 2026 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Package] Block editor /packages/block-editor [Package] Block library /packages/block-library [Package] Media Utils /packages/media-utils [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upload error notices don't appear when repeatedly selecting the same oversized file

2 participants