Site Health: Fix TypeError when copying debug information.

In [53164] the `clipboard.js` library was updated to from version 2.0.8 to 2.0.10, and in doing so caused a TypeError JavaScript error to be thrown when the copy button for debug information was used.

With the update, the `clipboard.js` library introduced an enhancement to its `.copy()` API, which now removes the fake DOM element used for copying content, which Site Health previously had to remove manually.

As this fake DOM element is now removed automatically, the copy function within the debug information screen can rely on the library performing the removal, instead of WordPress needing to do so manually.

Props hiren1094, costdev.
Fixes #56515.

git-svn-id: https://develop.svn.wordpress.org/trunk@54089 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Marius L. J
2022-09-06 22:03:23 +00:00
parent bfdc8eff83
commit 563e24ced1

View File

@@ -34,10 +34,6 @@ jQuery( function( $ ) {
// Hide success visual feedback after 3 seconds since last success.
successTimeout = setTimeout( function() {
successElement.addClass( 'hidden' );
// Remove the visually hidden textarea so that it isn't perceived by assistive technologies.
if ( clipboard.clipboardAction.fakeElem && clipboard.clipboardAction.removeFake ) {
clipboard.clipboardAction.removeFake();
}
}, 3000 );
// Handle success audible feedback.