diff --git a/projects/plugins/jetpack/changelog/fix-sharing-dialog-location b/projects/plugins/jetpack/changelog/fix-sharing-dialog-location new file mode 100644 index 0000000000000..305163f8beda8 --- /dev/null +++ b/projects/plugins/jetpack/changelog/fix-sharing-dialog-location @@ -0,0 +1,4 @@ +Significance: patch +Type: bugfix + +Sharing: Fix the location of the sharing dialog, so it is not always the first sharing element on the page diff --git a/projects/plugins/jetpack/extensions/blocks/sharing-buttons/view.js b/projects/plugins/jetpack/extensions/blocks/sharing-buttons/view.js index 524eb9668c995..90169f1f19989 100644 --- a/projects/plugins/jetpack/extensions/blocks/sharing-buttons/view.js +++ b/projects/plugins/jetpack/extensions/blocks/sharing-buttons/view.js @@ -39,7 +39,7 @@ if ( typeof window !== 'undefined' ) { if ( link?.href && isWebShareAPIEnabled( { url: link.href } ) ) { navigator.share( { url: link.href } ); } else { - const [ tooltip ] = document.getElementsByClassName( 'tooltiptext' ); + const [ tooltip ] = link.getElementsByClassName( 'tooltiptext' ); if ( tooltip && tooltip.style ) { tooltip.style.display = 'initial'; setTimeout( () => {