You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I'm getting the following error when trying to copy and paste text in the same editore
Uncaught TypeError: Cannot read properties of null (reading 'append')
at closeFragment (index.js:1720:38)
at closeFragment (index.js:1716:56)
at closeFragment (index.js:1716:56)
at replaceRange (index.js:1698:110)
at Transaction.replaceRange (index.js:2002:9)
at TextSelection.replace (index.js:90:16)
at TextSelection.replace (index.js:252:15)
at Transaction.replaceSelection (index.js:601:24)
at doPaste (index.js:3645:25)
at EditorView.pasteHTML (index.js:5660:16)
at Gn.pasteHTML (BlockNoteEditor.ts:1637:27)
at Bi (pasteExtension.ts:55:12)
at Object.defaultPasteHandler (pasteExtension.ts:120:28)
at BlockNoteExtensions.ts:274:23
at Plugin.paste (pasteExtension.ts:113:24)
at index.js:3108:26
at EditorView.someProp (index.js:5514:50)
at runCustomHandler (index.js:3106:17)
at view.dom.addEventListener.view.input.eventHandlers.<computed> (index.js:3075:53)
To Reproduce
Type anything in the editor
Copy part of the the text, Cmd+C
Arrow down and paste, Cmd+V
Boom
Adding the following to package.json seems to fix the issue:
I can confirm that this issue is happening on my side as well
It is fixed by using "prosemirror-model": "1.25.0", but only for raw text. If you copy-paste a piece of code from your IDE then this error shows up again.
Update: here's my temporary fix for this issue:
consteditor=useCreateBlockNote({pasteHandler: ({ event, defaultPasteHandler })=>{try{// Try to use the default copy paste handlerreturndefaultPasteHandler();}catch(e){// If the default copy past handler fails then at least try to paste the contents as regular textif(event.clipboardData?.types.includes('text/plain')){editor.pasteText(event.clipboardData.getData('text/plain'));returntrue;}throwe;}},});
Describe the bug
I'm getting the following error when trying to copy and paste text in the same editore
To Reproduce
Adding the following to package.json seems to fix the issue:
Here's the repo and a stackblitz demo-ing the issue:
Github Repo
Stackblitz
Misc
Node version: v23.10.0
Package manager: [email protected]
Browser: Arc
I'm a sponsor and would appreciate if you could look into this sooner than later 💖
The text was updated successfully, but these errors were encountered: