diff --git a/src/cdk/clipboard/pending-copy.ts b/src/cdk/clipboard/pending-copy.ts index 00f31ae450b1..61cf922579b9 100644 --- a/src/cdk/clipboard/pending-copy.ts +++ b/src/cdk/clipboard/pending-copy.ts @@ -36,7 +36,9 @@ export class PendingCopy { textarea.value = text; // Making the textarea `readonly` prevents the screen from jumping on iOS Safari (see #25169). textarea.readOnly = true; - this._document.body.appendChild(textarea); + // The element needs to be inserted into the fullscreen container, if the page + // is in fullscreen mode, otherwise the browser won't execute the copy command. + (this._document.fullscreenElement || this._document.body).appendChild(textarea); } /** Finishes copying the text. */ diff --git a/src/dev-app/clipboard/clipboard-demo.html b/src/dev-app/clipboard/clipboard-demo.html index 9d9834924dcf..7efb7e9362ce 100644 --- a/src/dev-app/clipboard/clipboard-demo.html +++ b/src/dev-app/clipboard/clipboard-demo.html @@ -12,3 +12,8 @@ + +
+ + +