File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,10 @@ class NewSnippet extends React.Component {
3636 document . getElementsByClassName ( 'new-snippet-lang-header' ) [ 0 ]
3737 . setAttribute ( 'style' , `height:${ newSnippetHeaderHeight } px` ) ;
3838 } ;
39+ this . onEditorLoad = ( editor ) => {
40+ // we want to disable built-in find in favor of browser's one
41+ editor . commands . removeCommand ( 'find' ) ;
42+ } ;
3943 this . postSnippet = this . postSnippet . bind ( this ) ;
4044 this . onSyntaxClick = this . onSyntaxClick . bind ( this ) ;
4145 this . onInputChange = this . onInputChange . bind ( this ) ;
@@ -122,6 +126,7 @@ class NewSnippet extends React.Component {
122126 height = "100%"
123127 focus
124128 theme = "textmate"
129+ onLoad = { this . onEditorLoad }
125130 setOptions = { {
126131 showFoldWidgets : false ,
127132 useWorker : false ,
Original file line number Diff line number Diff line change @@ -21,6 +21,10 @@ class Snippet extends React.Component {
2121 this . copyClipboard = ( e ) => {
2222 copyToClipboard ( e , 'embedded' ) ;
2323 } ;
24+ this . onEditorLoad = ( editor ) => {
25+ // we want to disable built-in find in favor of browser's one
26+ editor . commands . removeCommand ( 'find' ) ;
27+ } ;
2428 }
2529
2630 componentDidMount ( ) {
@@ -96,6 +100,7 @@ class Snippet extends React.Component {
96100 width = "100%"
97101 height = "100%"
98102 theme = "textmate"
103+ onLoad = { this . onEditorLoad }
99104 setOptions = { {
100105 readOnly : true ,
101106 highlightActiveLine : false ,
You can’t perform that action at this time.
0 commit comments