@@ -29,9 +29,12 @@ import {
2929import { useEffect , useState , CSSProperties } from 'react' ;
3030import { VimExtension , toggleVimMode , loadVimModeState } from '../utils/VimExtension' ;
3131import { KeySwapExtension } from '../utils/KeySwapExtension' ;
32+ import '../styles/editor-overrides.css' ;
3233
3334const tableStyles = {
3435 '.ProseMirror' : {
36+ overflow : 'auto' ,
37+ height : '100%' ,
3538 '& table' : {
3639 borderCollapse : 'collapse' ,
3740 margin : '1rem 0' ,
@@ -167,7 +170,7 @@ export function RichTextEditor({ content, onChange, isMobile }: RichTextEditorPr
167170 editorProps : {
168171 attributes : {
169172 class : 'rich-text-editor' ,
170- style : 'height: 100%' ,
173+ style : 'height: 100%; overflow: visible; ' ,
171174 } ,
172175 } ,
173176 } ) ;
@@ -189,6 +192,22 @@ export function RichTextEditor({ content, onChange, isMobile }: RichTextEditorPr
189192 }
190193 } , [ vimModeEnabled , editor ] ) ;
191194
195+ useEffect ( ( ) => {
196+ if ( isMobile ) {
197+ const handleResize = ( ) => {
198+ const vh = window . innerHeight * 0.01 ;
199+ document . documentElement . style . setProperty ( '--editor-vh' , `${ vh } px` ) ;
200+ } ;
201+
202+ handleResize ( ) ;
203+ window . addEventListener ( 'resize' , handleResize ) ;
204+
205+ return ( ) => {
206+ window . removeEventListener ( 'resize' , handleResize ) ;
207+ } ;
208+ }
209+ } , [ isMobile ] ) ;
210+
192211 if ( ! editor ) {
193212 return null ;
194213 }
@@ -379,9 +398,10 @@ export function RichTextEditor({ content, onChange, isMobile }: RichTextEditorPr
379398 borderBottom : '1px solid var(--mantine-color-gray-3)' ,
380399 borderTop : 'none' ,
381400 borderRadius : '8px' ,
382- padding : '1rem' ,
383- overflow : 'hidden' ,
384- flex : 1
401+ padding : '0.5rem' ,
402+ overflow : 'auto' ,
403+ flex : 1 ,
404+ WebkitOverflowScrolling : 'touch'
385405 } : {
386406 border : '1px solid var(--mantine-color-gray-3)' ,
387407 borderRadius : 'var(--mantine-radius-md)' ,
@@ -395,29 +415,23 @@ export function RichTextEditor({ content, onChange, isMobile }: RichTextEditorPr
395415 display : 'flex' ,
396416 flexDirection : 'column' ,
397417 height : '100%' ,
398- overflow : 'hidden'
418+ position : 'relative' ,
399419 } } >
400420 { ToolbarWrapper }
401421 < Box
402422 style = { {
403423 flex : '1 1 auto' ,
404- display : 'flex' ,
405- flexDirection : 'column' ,
406- minHeight : 0 ,
407- overflowY : 'auto' ,
408- WebkitOverflowScrolling : 'touch' ,
424+ overflow : 'auto' ,
425+ position : 'relative' ,
409426 ...tableStyles ,
410427 ...mobileBorderStyle
411428 } }
412429 >
413430 < EditorContent
414431 editor = { editorInstance }
415432 style = { {
416- flex : '1 1 auto' ,
417- display : 'flex' ,
418- flexDirection : 'column' ,
419433 height : '100%' ,
420- overflow : 'visible ' ,
434+ minHeight : '100% ' ,
421435 } }
422436 className = { `rich-text-table-container ${ isMobile ? 'mobile-editor' : '' } ` }
423437 />
0 commit comments