Add nested scroll support (#31)

This commit is contained in:
吴泽康
2026-04-01 12:00:00 +08:00
committed by GitHub
parent ec7e944a3d
commit 1c43577807
4 changed files with 36 additions and 4 deletions

View File

@@ -269,6 +269,13 @@ function serializeNode(
? 'paused'
: 'played';
}
// scroll
if ((n as HTMLElement).scrollLeft) {
attributes.rr_scrollLeft = (n as HTMLElement).scrollLeft;
}
if ((n as HTMLElement).scrollTop) {
attributes.rr_scrollTop = (n as HTMLElement).scrollTop;
}
if (needBlock) {
const { width, height } = (n as HTMLElement).getBoundingClientRect();
attributes.rr_width = `${width}px`;