@@ -357,8 +357,9 @@ const Editium: React.FC<EditiumProps> = ({
357357 const { attributes, children, element } = props ;
358358 const style = { margin : '0' , fontWeight : 'normal' } ;
359359 const alignStyle = ( element as CustomElement ) . align ? {
360- textAlign : ( element as CustomElement ) . align as 'left' | 'center' | 'right' | 'justify'
361- } : { } ;
360+ textAlign : ( element as CustomElement ) . align as 'left' | 'center' | 'right' | 'justify' ,
361+ width : '100%'
362+ } : { width : '100%' } ;
362363 const combinedStyle = { ...style , ...alignStyle } ;
363364
364365 switch ( ( element as CustomElement | LinkElement ) . type ) {
@@ -568,6 +569,9 @@ const Editium: React.FC<EditiumProps> = ({
568569 backgroundColor : '#fff' ,
569570 position : 'relative' ,
570571 overflow : 'auto' ,
572+ width : '100%' ,
573+ maxWidth : '100%' ,
574+ boxSizing : 'border-box' ,
571575 ...style ,
572576 } ;
573577
@@ -604,6 +608,10 @@ const Editium: React.FC<EditiumProps> = ({
604608 position: relative;
605609 min-height: inherit;
606610 height: 100%;
611+ width: 100%;
612+ max-width: 100%;
613+ overflow-x: hidden;
614+ box-sizing: border-box;
607615 }
608616
609617 /* Custom scrollbar styling for better UX */
@@ -630,12 +638,15 @@ const Editium: React.FC<EditiumProps> = ({
630638 opacity: 0.333;
631639 pointer-events: none;
632640 user-select: none;
633- display: inline- block !important;
641+ display: block !important;
634642 width: 100%;
635643 max-width: 100%;
636- white-space: nowrap ;
644+ white-space: pre-wrap ;
637645 margin: 0 !important;
638646 vertical-align: text-top;
647+ position: absolute;
648+ top: 0;
649+ left: 0;
639650 }
640651
641652 [data-slate-editor] p,
@@ -646,6 +657,8 @@ const Editium: React.FC<EditiumProps> = ({
646657 [data-slate-editor] h5,
647658 [data-slate-editor] h6 {
648659 position: relative;
660+ width: 100%;
661+ box-sizing: border-box;
649662 }
650663
651664 [data-slate-editor] [contenteditable="true"] {
0 commit comments