Make WordPress Core

Changeset 54089


Ignore:
Timestamp:
09/06/2022 10:03:23 PM (2 years ago)
Author:
Clorith
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/admin/site-health.js

    r53950 r54089  
    3535        successTimeout = setTimeout( function() {
    3636            successElement.addClass( 'hidden' );
    37             // Remove the visually hidden textarea so that it isn't perceived by assistive technologies.
    38             if ( clipboard.clipboardAction.fakeElem && clipboard.clipboardAction.removeFake ) {
    39                 clipboard.clipboardAction.removeFake();
    40             }
    4137        }, 3000 );
    4238
Note: See TracChangeset for help on using the changeset viewer.