@@ -36,13 +36,19 @@ const Tools = styled.div`
36
36
}
37
37
` ;
38
38
39
- const CodemirrorWarpper = styled ( CodeMirror ) `
40
- box-shadow: 0 0 0 1px rgb(16 22 26 / 10%), 0 0 0 rgb(16 22 26 / 0%), 0 1px 1px rgb(16 22 26 / 20%);
39
+ const CodemirrorWarpper = styled . div `
40
+ box-shadow:
41
+ 0 0 0 1px rgb(16 22 26 / 10%),
42
+ 0 0 0 rgb(16 22 26 / 0%),
43
+ 0 1px 1px rgb(16 22 26 / 20%);
41
44
margin: 0 auto;
42
45
text-align: left;
43
46
max-width: 995px;
44
47
overflow: auto;
45
48
border-radius: 5px;
49
+ margin-top: -30px;
50
+ z-index: 10;
51
+ position: relative;
46
52
` ;
47
53
48
54
const Warpper = styled . div `
@@ -88,26 +94,29 @@ export default function Example() {
88
94
} , [ ] ) ;
89
95
return (
90
96
< Warpper className = "wmde-markdown-var" >
91
- < CodemirrorWarpper
92
- value = { code }
93
- height = { `${ height } !important` }
94
- theme = { alls [ theme as keyof typeof alls ] || theme }
95
- editable = { editable }
96
- extensions = { extensions }
97
- autoFocus = { autofocus }
98
- basicSetup = { basicSetup }
99
- placeholder = { placeholder }
100
- onChange = { ( val ) => {
101
- // https://github.com/uiwjs/react-codemirror/issues/449
102
- // setCode(val)
103
- } }
104
- style = { {
105
- maxWidth : '995px' ,
106
- margin : '-18px auto 0 auto' ,
107
- position : 'relative' ,
108
- zIndex : 999 ,
109
- } }
110
- />
97
+ < CodemirrorWarpper >
98
+ < CodeMirror
99
+ value = { code }
100
+ height = { `${ height } !important` }
101
+ // @ts -ignore
102
+ theme = { alls [ theme as keyof typeof alls ] || theme }
103
+ editable = { editable }
104
+ extensions = { extensions }
105
+ autoFocus = { autofocus }
106
+ basicSetup = { basicSetup }
107
+ placeholder = { placeholder }
108
+ onChange = { ( val ) => {
109
+ // https://github.com/uiwjs/react-codemirror/issues/449
110
+ // setCode(val)
111
+ } }
112
+ style = { {
113
+ maxWidth : '995px' ,
114
+ margin : '-18px auto 0 auto' ,
115
+ position : 'relative' ,
116
+ zIndex : 999 ,
117
+ } }
118
+ />
119
+ </ CodemirrorWarpper >
111
120
< MarkdownDocument >
112
121
< Tools >
113
122
< Select
0 commit comments