diff --git a/aio/src/app/shared/copier.service.ts b/aio/src/app/shared/copier.service.ts index 420d8ef683..4b571de452 100644 --- a/aio/src/app/shared/copier.service.ts +++ b/aio/src/app/shared/copier.service.ts @@ -59,14 +59,13 @@ export class CopierService { style.padding = '0'; style.margin = '0'; - // Move element out of screen horizontally. - style.position = 'absolute'; - style[ isRTL ? 'right' : 'left' ] = '-9999px'; - - // Move element to the same position vertically. - const yPosition = window.pageYOffset || docElem.scrollTop; - style.top = yPosition + 'px'; + // Make the element invisible and move it out of screen horizontally. + style.opacity = '0'; + style.position = 'fixed'; + style.top = '0'; + style[isRTL ? 'right' : 'left'] = '-999em'; + textArea.setAttribute('aria-hidden', 'true'); textArea.setAttribute('readonly', ''); textArea.value = text;