Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion packages/react-devtools-shared/src/backend/fiber/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2251,8 +2251,23 @@ export function attach(
}
if (typeof instance.getClientRects === 'function') {
// DOM
const result: Array<Rect> = [];
const doc = instance.ownerDocument;
if (instance === doc.documentElement) {
// This is the document element. The size of this element is not actually
// what determines the whole scrollable area of the screen. Because any
// thing that overflows the document will also contribute to the scrollable.
// This is unlike overflow: scroll which clips those.
// Therefore, we use the scrollable size for this rect instead.
return [
{
x: 0,
y: 0,
width: instance.scrollWidth,
height: instance.scrollHeight,
},
];
}
const result: Array<Rect> = [];
const win = doc && doc.defaultView;
const scrollX = win ? win.scrollX : 0;
const scrollY = win ? win.scrollY : 0;
Expand Down
Loading