diff --git a/packages/react-devtools-scheduling-profiler/src/CanvasPage.js b/packages/react-devtools-scheduling-profiler/src/CanvasPage.js index 8c84eac1b1eb2..0caf20a4e3cb6 100644 --- a/packages/react-devtools-scheduling-profiler/src/CanvasPage.js +++ b/packages/react-devtools-scheduling-profiler/src/CanvasPage.js @@ -402,6 +402,12 @@ function AutoSizedCanvas({ const surface = surfaceRef.current; surface.handleInteraction(interaction); + // Flush any display work that got queued up as part of the previous interaction. + // Typically there should be no work, but certain interactions may need a second pass. + // For example, the ResizableView may collapse/expand its contents, + // which requires a second layout pass for an ancestor VerticalScrollOverflowView. + surface.displayIfNeeded(); + canvas.style.cursor = surface.getCurrentCursor() || 'default'; // Defer drawing to canvas until React's commit phase, to avoid drawing diff --git a/packages/react-devtools-scheduling-profiler/src/view-base/VerticalScrollOverflowView.js b/packages/react-devtools-scheduling-profiler/src/view-base/VerticalScrollOverflowView.js index 4986d4ac74165..fa066d2d981b4 100644 --- a/packages/react-devtools-scheduling-profiler/src/view-base/VerticalScrollOverflowView.js +++ b/packages/react-devtools-scheduling-profiler/src/view-base/VerticalScrollOverflowView.js @@ -80,7 +80,6 @@ const withVerticalScrollbarLayout: Layouter = (layout, containerFrame) => { return [laidOutContentLayoutInfo, laidOutScrollbarLayoutInfo]; }; -// TODO How do we handle resizing export class VerticalScrollOverflowView extends View { _contentView: View; _isProcessingOnChange: boolean = false;