File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed
packages/core/src/schema/blocks Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -63,28 +63,20 @@ export type CustomBlockImplementation<
6363 ) => PartialBlockFromConfig < T , I , S > [ "props" ] | undefined ;
6464} ;
6565
66- // Function that enables copying of selected content within non-selectable
67- // blocks .
66+ // Function that causes events within non-selectable blocks to be handled by the
67+ // browser instead of the editor .
6868export function applyNonSelectableBlockFix ( nodeView : NodeView , editor : Editor ) {
6969 nodeView . stopEvent = ( event ) => {
70- // Ensures copy events are handled by the browser and not by ProseMirror.
71- if (
72- event . type === "copy" ||
73- event . type === "cut" ||
74- event . type === "paste"
75- ) {
76- return true ;
77- }
7870 // Blurs the editor on mouse down as the block is non-selectable. This is
7971 // mainly done to prevent UI elements like the formatting toolbar from being
8072 // visible while content within a non-selectable block is selected.
8173 if ( event . type === "mousedown" ) {
8274 setTimeout ( ( ) => {
8375 editor . view . dom . blur ( ) ;
8476 } , 10 ) ;
85- return true ;
8677 }
87- return false ;
78+
79+ return true ;
8880 } ;
8981}
9082
You can’t perform that action at this time.
0 commit comments