Skip to content

Commit

Permalink
External Libraries: Accessibility: Clean up clipboard.js Copy butto…
Browse files Browse the repository at this point in the history
…ns from focus management workaround.

`clipboard.js` used to suffer from a bug that triggered a focus loss when activating the Copy buttons. The bug was fixed a while ago with the `clipboard.js` 2.0.11 release so that the workaround implemented in WordPress is no longer necessary.

Props dhrumilk, paulkevan, afercia.
Fixes #60139.


git-svn-id: https://develop.svn.wordpress.org/trunk@57231 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
afercia committed Dec 28, 2023
1 parent 0928c1d commit da1f881
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 10 deletions.
2 changes: 0 additions & 2 deletions src/js/_enqueues/admin/media.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,6 @@

// Clear the selection and move focus back to the trigger.
event.clearSelection();
// Handle ClipboardJS focus bug, see https://github.com/zenorocha/clipboard.js/issues/680.
triggerElement.trigger( 'focus' );

// Show success visual feedback.
clearTimeout( copyAttachmentURLSuccessTimeout );
Expand Down
2 changes: 0 additions & 2 deletions src/js/_enqueues/admin/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -1303,8 +1303,6 @@ jQuery( function($) {

// Clear the selection and move focus back to the trigger.
event.clearSelection();
// Handle ClipboardJS focus bug, see https://github.com/zenorocha/clipboard.js/issues/680
triggerElement.trigger( 'focus' );

// Show success visual feedback.
clearTimeout( copyAttachmentURLSuccessTimeout );
Expand Down
2 changes: 0 additions & 2 deletions src/js/_enqueues/admin/site-health.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ jQuery( function( $ ) {

// Clear the selection and move focus back to the trigger.
e.clearSelection();
// Handle ClipboardJS focus bug, see https://github.com/zenorocha/clipboard.js/issues/680
triggerElement.trigger( 'focus' );

// Show success visual feedback.
clearTimeout( successTimeout );
Expand Down
2 changes: 0 additions & 2 deletions src/js/_enqueues/vendor/plupload/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,6 @@ function copyAttachmentUploadURLClipboard() {

// Clear the selection and move focus back to the trigger.
event.clearSelection();
// Handle ClipboardJS focus bug, see https://github.com/zenorocha/clipboard.js/issues/680
triggerElement.trigger( 'focus' );
// Show success visual feedback.
clearTimeout( successTimeout );
successElement.removeClass( 'hidden' );
Expand Down
2 changes: 0 additions & 2 deletions src/js/media/views/attachment/details.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ Details = Attachment.extend(/** @lends wp.media.view.Attachment.Details.prototyp

// Clear the selection and move focus back to the trigger.
event.clearSelection();
// Handle ClipboardJS focus bug, see https://github.com/zenorocha/clipboard.js/issues/680
triggerElement.trigger( 'focus' );

// Show success visual feedback.
clearTimeout( successTimeout );
Expand Down

0 comments on commit da1f881

Please sign in to comment.