[wp-trac] [WordPress Trac] #63561: The media upload button is not disabled when no image has been uploaded
WordPress Trac
noreply at wordpress.org
Sat Nov 29 04:34:45 UTC 2025
#63561: The media upload button is not disabled when no image has been uploaded
------------------------------+---------------------------------
Reporter: karinchristen | Owner: joedolson
Type: enhancement | Status: reopened
Priority: normal | Milestone: 6.9
Component: Media | Version:
Severity: normal | Resolution:
Keywords: has-patch commit | Focuses: ui, administration
------------------------------+---------------------------------
Changes (by wildworks):
* status: closed => reopened
* resolution: fixed =>
Comment:
In [60449], a `required` attribute was added to the file input field in
the media uploader.
This field is visually hidden by default (when JS is enabled). As a
result, when the media uploader is placed inside a `form` element, form
submission fails with the following browser console error:
{{{
An invalid form control with name='async-upload' is not focusable.
}}}
To prevent this issue, we have removed the required attribute as a
temporary solution for 6.9. See [61320].
This means that in environments where JS is disabled, forms can be
submitted via the Upload button even if no files are attached. This is not
an issue in itself because there is server-side validation, but I'd like
to reopen this ticket just in case.
If you can tolerate this issue, please re-close this ticket. If not, we
may need to consider a different approach. One approach might be to
restore the `required` attribute, but dynamically remove it if the file
input element is visually hidden.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63561#comment:13>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list