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<
63
63
) => PartialBlockFromConfig < T , I , S > [ "props" ] | undefined ;
64
64
} ;
65
65
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 .
68
68
export function applyNonSelectableBlockFix ( nodeView : NodeView , editor : Editor ) {
69
69
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
- }
78
70
// Blurs the editor on mouse down as the block is non-selectable. This is
79
71
// mainly done to prevent UI elements like the formatting toolbar from being
80
72
// visible while content within a non-selectable block is selected.
81
73
if ( event . type === "mousedown" ) {
82
74
setTimeout ( ( ) => {
83
75
editor . view . dom . blur ( ) ;
84
76
} , 10 ) ;
85
- return true ;
86
77
}
87
- return false ;
78
+
79
+ return true ;
88
80
} ;
89
81
}
90
82
You can’t perform that action at this time.
0 commit comments