@@ -32,7 +32,6 @@ export interface MarkdownEditorProps {
32
32
}
33
33
34
34
type MarkdownEditorState = {
35
- shadow : boolean ;
36
35
addLink : {
37
36
top : number | null ;
38
37
bottom : number | null ;
@@ -208,7 +207,7 @@ function WriterHead({
208
207
children : React . ReactNode ;
209
208
} ) {
210
209
const screenHeight =
211
- ( typeof window !== 'undefined' && window . screen . height ) || 0 ;
210
+ ( typeof window !== 'undefined' && window . screen . height ) || 508 ;
212
211
213
212
const springStyle = useSpring ( {
214
213
maxHeight : hide ? 0 : screenHeight * 0.5 ,
@@ -233,7 +232,6 @@ export default class WriteMarkdownEditor extends React.Component<
233
232
editorElement = React . createRef < HTMLTextAreaElement > ( ) ;
234
233
toolbarTop = 0 ;
235
234
state = {
236
- shadow : false ,
237
235
addLink : {
238
236
top : 0 ,
239
237
bottom : 0 ,
@@ -333,25 +331,6 @@ export default class WriteMarkdownEditor extends React.Component<
333
331
}
334
332
} ;
335
333
336
- handleScroll = ( e : React . UIEvent < HTMLDivElement > ) => {
337
- const { shadow } = this . state ;
338
- const nextShadow = e . currentTarget . scrollTop > this . toolbarTop ;
339
- // console.log(e.currentTarget.scrollTop, this.toolbarTop);
340
- if ( shadow !== nextShadow ) {
341
- this . setState ( {
342
- shadow : nextShadow ,
343
- } ) ;
344
- }
345
- if ( this . block . current ) {
346
- const { clientWidth } = this . block . current ;
347
- if ( clientWidth !== this . state . clientWidth ) {
348
- this . setState ( {
349
- clientWidth,
350
- } ) ;
351
- }
352
- }
353
- } ;
354
-
355
334
handleResize = ( ) => {
356
335
if ( this . block . current ) {
357
336
this . setState ( {
@@ -810,14 +789,10 @@ ${selected}
810
789
} ;
811
790
812
791
public render ( ) {
813
- const { shadow , addLink, clientWidth } = this . state ;
792
+ const { addLink, clientWidth } = this . state ;
814
793
const { title, tagInput, footer } = this . props ;
815
794
return (
816
- < MarkdownEditorBlock
817
- ref = { this . block }
818
- onScroll = { this . handleScroll }
819
- data-testid = "codemirror"
820
- >
795
+ < MarkdownEditorBlock ref = { this . block } data-testid = "codemirror" >
821
796
< div className = "wrapper" >
822
797
< WriterHead hide = { this . state . hideUpper } >
823
798
{ ssrEnabled ? (
@@ -833,7 +808,7 @@ ${selected}
833
808
{ tagInput }
834
809
</ WriterHead >
835
810
< Toolbar
836
- shadow = { shadow || this . state . hideUpper }
811
+ shadow = { this . state . hideUpper }
837
812
mode = "MARKDOWN"
838
813
onClick = { this . handleToolbarClick }
839
814
onConvert = { this . handleAskConvert }
0 commit comments