[wp-trac] [WordPress Trac] #48463: Copy link button in media
WordPress Trac
noreply at wordpress.org
Wed Nov 13 11:55:36 UTC 2019
#48463: Copy link button in media
--------------------------+--------------------------------------------
Reporter: theolg | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 5.4
Component: Media | Version: 5.2
Severity: normal | Resolution:
Keywords: needs-patch | Focuses: ui, accessibility, javascript
--------------------------+--------------------------------------------
Changes (by afercia):
* keywords: good-first-bug has-patch needs-testing => needs-patch
* focuses: ui, accessibility => ui, accessibility, javascript
Comment:
@vabrashev @sajjad67 thanks for the patches! A few important
considerations:
- the copy link needs to work in all the media views, for example also in
the "Add Media" modal and everywhere the URL input field is displayed
- I'd suggest to explore building a new "copy button" view: it would also
allow to avoid too many elements targeted with JS, which is sort of an
anti-pattern in backbone.js
- most importantly: the new view would be reusable in other places
- I'd recommend to not make the `<label>` element clickable, as that's not
the expected behavior
- in #41612 it was mentioned a better approach would be: entirely remove
the input field and just use a "Copy link" button
- at that point the attachment URL could be displayed in plain text as
there's no need for a readonly input field
- the strings need to be translatable: see `Sorry, unable to copy`, same
for the CSS generated content: `Link Copied!` (so I'm afraid we can't use
the CSS approach)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/48463#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list