File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
packages/lexical-clipboard/src Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -468,7 +468,7 @@ export async function copyToClipboard(
468468
469469 const rootElement = editor . getRootElement ( ) ;
470470 const editorWindow = editor . _window || window ;
471- const windowDocument = window . document ;
471+ const windowDocument = editorWindow . document ;
472472 const domSelection = getDOMSelection ( editorWindow ) ;
473473 if ( rootElement === null || domSelection === null ) {
474474 return false ;
@@ -489,7 +489,7 @@ export async function copyToClipboard(
489489 if ( objectKlassEquals ( secondEvent , ClipboardEvent ) ) {
490490 removeListener ( ) ;
491491 if ( clipboardEventTimeout !== null ) {
492- window . clearTimeout ( clipboardEventTimeout ) ;
492+ editorWindow . clearTimeout ( clipboardEventTimeout ) ;
493493 clipboardEventTimeout = null ;
494494 }
495495 resolve ( $copyToClipboardEvent ( editor , secondEvent , data ) ) ;
@@ -501,7 +501,7 @@ export async function copyToClipboard(
501501 ) ;
502502 // If the above hack execCommand hack works, this timeout code should never fire. Otherwise,
503503 // the listener will be quickly freed so that the user can reuse it again
504- clipboardEventTimeout = window . setTimeout ( ( ) => {
504+ clipboardEventTimeout = editorWindow . setTimeout ( ( ) => {
505505 removeListener ( ) ;
506506 clipboardEventTimeout = null ;
507507 resolve ( false ) ;
You can’t perform that action at this time.
0 commit comments