From 063c6ebb88ef36aac7993cc1edb7a74e6276dcaf Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 28 May 2026 22:48:33 +0200 Subject: [PATCH] fix copied message inside clipboard --- src/js/_enqueues/admin/privacy-tools.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/js/_enqueues/admin/privacy-tools.js b/src/js/_enqueues/admin/privacy-tools.js index 4e12939be7621..9e32a3592a493 100644 --- a/src/js/_enqueues/admin/privacy-tools.js +++ b/src/js/_enqueues/admin/privacy-tools.js @@ -292,9 +292,12 @@ jQuery( function( $ ) { // Setup copy. window.getSelection().removeAllRanges(); - // Hide tutorial content to remove from copied content. + // Hide tutorial content and the actions toolbar (which contains + // the "Copied!" notice and button label) before selecting, so + // neither ends up in the copied text - see #58969. range = document.createRange(); $parent.addClass( 'hide-privacy-policy-tutorial' ); + $parent.find( '.privacy-settings-accordion-actions' ).addClass( 'hide-privacy-policy-tutorial' ); // Copy action. range.selectNodeContents( $parent[0] ); @@ -302,6 +305,7 @@ jQuery( function( $ ) { document.execCommand( 'copy' ); // Reset section. + $parent.find( '.privacy-settings-accordion-actions' ).removeClass( 'hide-privacy-policy-tutorial' ); $parent.removeClass( 'hide-privacy-policy-tutorial' ); window.getSelection().removeAllRanges();