@@ -28,10 +28,10 @@ qx.Class.define("osparc.ui.markdown.Markdown2", {
2828 this . base ( arguments ) ;
2929
3030 this . set ( {
31- allowGrowX : true ,
31+ allowGrowX : false ,
3232 allowGrowY : true ,
33- overflowX : "hidden" ,
34- overflowY : "hidden" ,
33+ overflowX : "hidden" , // hide scrollbars
34+ overflowY : "hidden" , // hide scrollbars
3535 } ) ;
3636
3737 const markdownCssUri = qx . util . ResourceManager . getInstance ( ) . toUri ( "marked/markdown.css" ) ;
@@ -77,7 +77,8 @@ qx.Class.define("osparc.ui.markdown.Markdown2", {
7777 } ,
7878
7979 statics : {
80- WRAP_CLASS : "osparc-md-root"
80+ MD_ROOT : "osparc-md-root" ,
81+ MD_MEASURE : "osparc-md-measure" ,
8182 } ,
8283
8384 members : {
@@ -119,8 +120,8 @@ qx.Class.define("osparc.ui.markdown.Markdown2", {
119120 const max = 220 ;
120121 if ( max ) {
121122 mdRoot = `
122- <div class="${ this . self ( ) . WRAP_CLASS } " style="display:flow-root;">
123- <div class="osparc-md-measure "
123+ <div class="${ this . self ( ) . MD_ROOT } " style="display:flow-root;">
124+ <div class="${ this . self ( ) . MD_MEASURE } "
124125 style="
125126 display:inline-block;
126127 width:max-content;
@@ -134,7 +135,7 @@ qx.Class.define("osparc.ui.markdown.Markdown2", {
134135 ` ;
135136 } else {
136137 mdRoot = `
137- <div class="${ this . self ( ) . WRAP_CLASS } " style="display:flow-root;">
138+ <div class="${ this . self ( ) . MD_ROOT } " style="display:flow-root;">
138139 ${ safeHtml }
139140 </div>` ;
140141 }
@@ -183,8 +184,8 @@ qx.Class.define("osparc.ui.markdown.Markdown2", {
183184 void domElement . offsetHeight ;
184185
185186 // measure the wrapper we injected (covers ALL children)
186- const root = domElement . querySelector ( "." + this . self ( ) . WRAP_CLASS ) || domElement ;
187- const meas = root . querySelector ( ".osparc-md-measure" ) || root ;
187+ const root = domElement . querySelector ( "." + this . self ( ) . MD_ROOT ) || domElement ;
188+ const meas = root . querySelector ( "." + this . self ( ) . MD_MEASURE ) || root ;
188189
189190 const rH = meas . getBoundingClientRect ( ) . height ;
190191 const rW = meas . getBoundingClientRect ( ) . width ;
@@ -198,7 +199,6 @@ qx.Class.define("osparc.ui.markdown.Markdown2", {
198199 this . setHeight ( totalH ) ;
199200
200201 // width: shrink-to-fit, but cap at a max
201- this . setAllowGrowX ( false ) ; // prevent parent layout from stretching it
202202 this . setMaxWidth ( null ) ; // measurer already capped; we set exact width
203203 this . setMinWidth ( 1 ) ; // avoid 0 when empty
204204 this . setWidth ( totalW ) ; // exact bubble width
0 commit comments