Opened 3 months ago
Last modified 4 days ago
#63238 accepted defect (bug)
Removed `target="_blank"` from Browser Uploader Link
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.9 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Media | Keywords: | has-patch has-screenshots target-blank |
Focuses: | accessibility, administration | Cc: |
Description
While visiting the wp-admin/media-new.php
page, I noticed that the Browser Uploader link included an unnecessary target="_blank"
attribute.
Reason for Removal:
The Browser Uploader link does not navigate to a new page, it simply toggles the browser uploader section dynamically without reloading the page. Therefore, the target="_blank"
attribute is redundant and should be removed.
Attachments (1)
Change History (5)
This ticket was mentioned in PR #8654 on WordPress/wordpress-develop by @dilipbheda.
3 months ago
#1
This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.
4 days ago
#4
@
4 days ago
- Milestone changed from Awaiting Review to 6.9
- Owner set to joedolson
- Status changed from new to accepted
Good catch, @dilipbheda!
I'm thinking that we should also semantically change this to a button. To keep things simple, we might want to just add role="button"
and add the extra key handler to the events to support spacebar triggering.
That would also continue to allow users to open in a new tab if they are accustomed to doing that, though I wonder how often that actually happens...
Yes, the browser uploader link apparently stays on the same page, behaving more like a button, unless you purposely open it in a new tab (with
Ctrl
+click or similar)..preventDefault()
and hides the multi-file uploader by adding the `html-uploader` class.For the patch, I would prefer to keep the translatable string as it is, replacing
target="_blank"
with an empty string. Then translators would not need to update anything, and the current string would still be available in case a future change requires additional attributes.However, if changing the string is important, it would only have one
%s
placeholder: