[wp-trac] [WordPress Trac] #50322: Site Health "copy info" button: fix focus loss and other improvements

WordPress Trac noreply at wordpress.org
Thu Jun 4 21:15:22 UTC 2020


#50322: Site Health "copy info" button: fix focus loss and other improvements
------------------------------+----------------------------
 Reporter:  afercia           |       Owner:  (none)
     Type:  defect (bug)      |      Status:  new
 Priority:  normal            |   Milestone:  5.5
Component:  Site Health       |     Version:  5.2
 Severity:  normal            |  Resolution:
 Keywords:  has-patch commit  |     Focuses:  accessibility
------------------------------+----------------------------
Changes (by afercia):

 * keywords:  needs-patch => has-patch commit


Comment:

 [attachment:"50322.diff"]:

 - uses the `clearSelection()` function from `ClipboardJS`
 - moves focus back to the trigger button to remediate
 https://github.com/zenorocha/clipboard.js/issues/680
 - uses `setTimeout` / `clearTimeout` to hide the "Copied!" visual feedback
 after 3 seconds since last successful copy action
 - minor JS coding standards
 - simplifies the CSS

 To Test:
 - patch and build
 - repeat the steps in the ticket description
 - observe focus is moved back to the Copy button (actually it's so fast
 that it can't be perceived visually)

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/50322#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list