File tree Expand file tree Collapse file tree 2 files changed +25
-6
lines changed
packages/react-devtools-shared/src/devtools/views/SuspenseTab Expand file tree Collapse file tree 2 files changed +25
-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 @@ -16,6 +16,7 @@ import {
1616 useRef ,
1717 Fragment ,
1818} from 'react' ;
19+ import { flushSync } from 'react-dom' ;
1920
2021import {
2122 localStorageGetItem ,
@@ -186,6 +187,9 @@ function SynchronizedScrollContainer({
186187 if ( element === null ) {
187188 return ;
188189 }
190+ // Mirror the viewport aspect ratio of the real window.
191+ const viewportAspectRatio = ( right - left ) / ( bottom - top ) ;
192+ element . style . aspectRatio = viewportAspectRatio ;
189193 const scale = scaleRef . current / element . clientWidth ;
190194 const targetLeft = Math . round ( left / scale ) ;
191195 const targetTop = Math . round ( top / scale ) ;
@@ -503,11 +507,13 @@ function SuspenseTab(_: {}) {
503507 orientation = "horizontal"
504508 />
505509 </ header >
506- < SynchronizedScrollContainer
507- className = { styles . Rects }
508- scaleRef = { scaleRef } >
509- < SuspenseRects scaleRef = { scaleRef } />
510- </ SynchronizedScrollContainer >
510+ < div className = { styles . RectsBox } >
511+ < SynchronizedScrollContainer
512+ className = { styles . Rects }
513+ scaleRef = { scaleRef } >
514+ < SuspenseRects scaleRef = { scaleRef } />
515+ </ SynchronizedScrollContainer >
516+ </ div >
511517 < footer className = { styles . SuspenseTreeViewFooter } >
512518 < SuspenseTimeline />
513519 < div className = { styles . SuspenseTreeViewFooterButtons } >
You can’t perform that action at this time.
0 commit comments