Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/lexical-clipboard/src/clipboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ export async function copyToClipboard(

const rootElement = editor.getRootElement();
const editorWindow = editor._window || window;
const windowDocument = window.document;
const windowDocument = editorWindow.document;
const domSelection = getDOMSelection(editorWindow);
if (rootElement === null || domSelection === null) {
return false;
Expand All @@ -489,7 +489,7 @@ export async function copyToClipboard(
if (objectKlassEquals(secondEvent, ClipboardEvent)) {
removeListener();
if (clipboardEventTimeout !== null) {
window.clearTimeout(clipboardEventTimeout);
editorWindow.clearTimeout(clipboardEventTimeout);
clipboardEventTimeout = null;
}
resolve($copyToClipboardEvent(editor, secondEvent, data));
Expand All @@ -501,7 +501,7 @@ export async function copyToClipboard(
);
// If the above hack execCommand hack works, this timeout code should never fire. Otherwise,
// the listener will be quickly freed so that the user can reuse it again
clipboardEventTimeout = window.setTimeout(() => {
clipboardEventTimeout = editorWindow.setTimeout(() => {
removeListener();
clipboardEventTimeout = null;
resolve(false);
Expand Down
Loading