Skip to content

fix(cdk/clipboard): let Clipboard.copy refocus prior focus without …#33217

Open
JoostK wants to merge 1 commit into
angular:mainfrom
JoostK:clipboard-prevent-scroll
Open

fix(cdk/clipboard): let Clipboard.copy refocus prior focus without …#33217
JoostK wants to merge 1 commit into
angular:mainfrom
JoostK:clipboard-prevent-scroll

Conversation

@JoostK

@JoostK JoostK commented May 6, 2026

Copy link
Copy Markdown
Member

…initiating scoll

ClipboardCopy.copy and its underlying PendingCopy.copy insert a temporary textarea with the contents to copy, selecting all its text and thereby changing the focused element. The focus is restored upon completion, but this could initiate a scroll interaction to scroll the element into view. This commit avoids this behavior by passing preventScroll: true.

…initiating scoll

`ClipboardCopy.copy` and its underlying `PendingCopy.copy` insert a temporary textarea
with the contents to copy, selecting all its text and thereby changing the focused element.
The focus is restored upon completion, but this could initiate a scroll interaction to
scroll the element into view. This commit avoids this behavior by passing `preventScroll: true`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

1 participant