File tree Expand file tree Collapse file tree 3 files changed +4
-0
lines changed
packages/react-devtools-shared/src
backend/views/Highlighter
devtools/views/SuspenseTab Expand file tree Collapse file tree 3 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ export default function setupHighlighter(
2929 bridge . addListener ( 'startInspectingHost' , startInspectingHost ) ;
3030 bridge . addListener ( 'stopInspectingHost' , stopInspectingHost ) ;
3131 bridge . addListener ( 'scrollTo' , scrollDocumentTo ) ;
32+ bridge . addListener ( 'requestScrollPosition' , sendScroll ) ;
3233
3334 let applyingScroll = false ;
3435
Original file line number Diff line number Diff line change @@ -256,6 +256,7 @@ type FrontendEvents = {
256256 startProfiling : [ StartProfilingParams ] ,
257257 stopInspectingHost : [ boolean ] ,
258258 scrollTo : [ { x : number , y : number } ] ,
259+ requestScrollPosition : [ ] ,
259260 stopProfiling : [ ] ,
260261 storeAsGlobal : [ StoreAsGlobalParams ] ,
261262 updateComponentFilters : [ Array < ComponentFilter > ] ,
Original file line number Diff line number Diff line change @@ -248,6 +248,8 @@ function SynchronizedScrollContainer({
248248 useEffect ( ( ) => {
249249 const callback = scrollContainerTo ;
250250 bridge . addListener ( 'scrollTo' , callback ) ;
251+ // Ask for the current scroll position when we mount so we can attach ourselves to it.
252+ bridge . send ( 'requestScrollPosition' ) ;
251253 return ( ) => bridge . removeListener ( 'scrollTo' , callback ) ;
252254 } , [ bridge ] ) ;
253255
You can’t perform that action at this time.
0 commit comments