Accessibility: Site Health: Improve the "Copy site info" button accessibility.

- avoids a focus loss when clicking the "Copy site info" button
- uses `setTimeout()` and `clearTimeout()` to properly handle the "Copied!" text
- minor JavaScript coding standards

Props audrasjb, Clorith, afercia.
See #48463, #50335.
Fixes #50322.


git-svn-id: https://develop.svn.wordpress.org/trunk@48233 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrea Fercia
2020-06-30 13:24:12 +00:00
parent 36a39ff333
commit 2df56667b3
3 changed files with 35 additions and 18 deletions
+6 -8
View File
@@ -203,22 +203,16 @@
}
.site-health-copy-buttons .copy-button-wrapper {
display: inline-flex;
align-items: center;
margin: 0.5rem 0 1rem;
}
.site-health-copy-buttons .success {
display: none;
color: #40860a;
line-height: 1.8;
margin-left: 0.5rem;
}
.site-health-copy-buttons .success.visible {
display: inline-block;
height: 30px;
line-height: 2.30769231;
}
.site-status-has-issues.hide {
display: none;
}
@@ -456,6 +450,10 @@
padding-bottom: 0;
font-weight: 600;
}
.wp-core-ui .site-health-copy-buttons .copy-button {
margin-bottom: 0;
}
}
/* The breakpoint is usually at 960px, the additional space is to allow for the margin. */