File tree Expand file tree Collapse file tree 2 files changed +24
-6
lines changed
packages/react-devtools-shared/src/devtools/views/SuspenseTab Expand file tree Collapse file tree 2 files changed +24
-6
lines changed Original file line number Diff line number Diff line change 106106 overflow : auto;
107107}
108108
109+ .RectsBox {
110+ position : relative;
111+ flex-grow : 1 ;
112+ background : var (--color-border );
113+ }
114+
109115.Rects {
116+ max-width : 100% ;
117+ max-height : 100% ;
118+ width : auto;
119+ height : auto;
120+ margin : auto;
121+ position : absolute;
122+ inset : 0 ;
110123 padding : 0.25rem ;
111- flex-grow : 1 ;
112124 overflow : auto;
125+ background-color : var (--color-background );
113126}
114127
115128.SuspenseTreeViewHeader {
Original file line number Diff line number Diff line change @@ -186,6 +186,9 @@ function SynchronizedScrollContainer({
186186 if ( element === null ) {
187187 return ;
188188 }
189+ // Mirror the viewport aspect ratio of the real window.
190+ const viewportAspectRatio = ( right - left ) / ( bottom - top ) ;
191+ element . style . aspectRatio = viewportAspectRatio ;
189192 const scale = scaleRef . current / element . clientWidth ;
190193 const targetLeft = Math . round ( left / scale ) ;
191194 const targetTop = Math . round ( top / scale ) ;
@@ -503,11 +506,13 @@ function SuspenseTab(_: {}) {
503506 orientation = "horizontal"
504507 />
505508 </ header >
506- < SynchronizedScrollContainer
507- className = { styles . Rects }
508- scaleRef = { scaleRef } >
509- < SuspenseRects scaleRef = { scaleRef } />
510- </ SynchronizedScrollContainer >
509+ < div className = { styles . RectsBox } >
510+ < SynchronizedScrollContainer
511+ className = { styles . Rects }
512+ scaleRef = { scaleRef } >
513+ < SuspenseRects scaleRef = { scaleRef } />
514+ </ SynchronizedScrollContainer >
515+ </ div >
511516 < footer className = { styles . SuspenseTreeViewFooter } >
512517 < SuspenseTimeline />
513518 < div className = { styles . SuspenseTreeViewFooterButtons } >
You can’t perform that action at this time.
0 commit comments