Add nested scroll support (#31)

This commit is contained in:
吴泽康
2020-07-25 15:05:45 +08:00
committed by GitHub
parent 785ff391b9
commit f7d43f5fee
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`;