File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ import CodeMirror from '@uiw/react-codemirror' ;
2
+ import { langs } from '@uiw/codemirror-extensions-langs' ;
3
+ import * as events from '@uiw/codemirror-extensions-events' ;
4
+ import { Fragment } from 'react' ;
5
+
6
+ /**
7
+ * https://github.com/uiwjs/react-codemirror/issues/650
8
+ */
9
+ export function Component ( ) {
10
+ const extension = events . content ( {
11
+ paste : ( event ) => {
12
+ event . preventDefault ( ) ;
13
+ } ,
14
+ } ) ;
15
+ return (
16
+ < Fragment >
17
+ < CodeMirror
18
+ value = { `console.log('hello')` }
19
+ theme = "none"
20
+ height = "400px !important"
21
+ width = "100%"
22
+ style = { { margin : '0 0 23px 0' , flex : 1 } }
23
+ extensions = { [ langs . markdown ( ) , extension ] }
24
+ />
25
+ </ Fragment >
26
+ ) ;
27
+ }
Original file line number Diff line number Diff line change @@ -658,6 +658,11 @@ export const routes: MenuRouteObject[] = [
658
658
label : 'How to remove all syntax highlighting?' ,
659
659
lazy : ( ) => import ( './pages/examples/Example431' ) ,
660
660
} ,
661
+ {
662
+ path : '650' ,
663
+ label : 'How To Disable Copy Paste in Editor?' ,
664
+ lazy : ( ) => import ( './pages/examples/Example650' ) ,
665
+ } ,
661
666
{
662
667
path : '674' ,
663
668
label : 'Browser spell checking' ,
You can’t perform that action at this time.
0 commit comments