a tool for shared writing and social publishing
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

handle pasting on 0 indexed text selections

+5 -2
+5 -2
components/Blocks/TextBlock/useHandlePaste.ts
··· 487 487 let block = useEditorStates.getState().editorStates[entityID]; 488 488 if (block) { 489 489 let tr = block.editor.tr; 490 - if (block.editor.selection.from && block.editor.selection.to) 490 + if ( 491 + block.editor.selection.from !== undefined && 492 + block.editor.selection.to !== undefined 493 + ) 491 494 tr.delete(block.editor.selection.from, block.editor.selection.to); 492 - tr.insert(block.editor.selection.from || 0, content.content); 495 + tr.insert(block.editor.selection.from || 1, content.content); 493 496 let newState = block.editor.apply(tr); 494 497 setEditorState(entityID, { 495 498 editor: newState,