fix some safari's scroll related issue
This commit is contained in:
@@ -52,7 +52,9 @@
|
|||||||
"typescript": "^3.1.6"
|
"typescript": "^3.1.6"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@types/smoothscroll-polyfill": "^0.3.0",
|
||||||
"mitt": "^1.1.3",
|
"mitt": "^1.1.3",
|
||||||
"rrweb-snapshot": "^0.6.11"
|
"rrweb-snapshot": "^0.6.11",
|
||||||
|
"smoothscroll-polyfill": "^0.4.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -272,10 +272,11 @@ function initScrollObserver(cb: scrollCallback): listenerHandler {
|
|||||||
}
|
}
|
||||||
const id = mirror.getId(evt.target as INode);
|
const id = mirror.getId(evt.target as INode);
|
||||||
if (evt.target === document) {
|
if (evt.target === document) {
|
||||||
|
const scrollEl = (document.scrollingElement || document.documentElement)!;
|
||||||
cb({
|
cb({
|
||||||
id,
|
id,
|
||||||
x: document.documentElement!.scrollLeft,
|
x: scrollEl.scrollLeft,
|
||||||
y: document.documentElement!.scrollTop,
|
y: scrollEl.scrollTop,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
cb({
|
cb({
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { rebuild, buildNodeWithSN } from 'rrweb-snapshot';
|
import { rebuild, buildNodeWithSN } from 'rrweb-snapshot';
|
||||||
import * as mittProxy from 'mitt';
|
import * as mittProxy from 'mitt';
|
||||||
|
import * as smoothscroll from 'smoothscroll-polyfill';
|
||||||
import Timer from './timer';
|
import Timer from './timer';
|
||||||
import {
|
import {
|
||||||
EventType,
|
EventType,
|
||||||
@@ -20,6 +21,8 @@ import { mirror } from '../utils';
|
|||||||
import injectStyleRules from './styles/inject-style';
|
import injectStyleRules from './styles/inject-style';
|
||||||
import './styles/style.css';
|
import './styles/style.css';
|
||||||
|
|
||||||
|
smoothscroll.polyfill();
|
||||||
|
|
||||||
// https://github.com/rollup/rollup/issues/1267#issuecomment-296395734
|
// https://github.com/rollup/rollup/issues/1267#issuecomment-296395734
|
||||||
// tslint:disable-next-line
|
// tslint:disable-next-line
|
||||||
const mitt = (mittProxy as any).default || mittProxy;
|
const mitt = (mittProxy as any).default || mittProxy;
|
||||||
@@ -144,6 +147,7 @@ export class Replayer {
|
|||||||
|
|
||||||
this.iframe = document.createElement('iframe');
|
this.iframe = document.createElement('iframe');
|
||||||
this.iframe.setAttribute('sandbox', 'allow-same-origin');
|
this.iframe.setAttribute('sandbox', 'allow-same-origin');
|
||||||
|
this.iframe.setAttribute('scrolling', 'no');
|
||||||
this.wrapper.appendChild(this.iframe);
|
this.wrapper.appendChild(this.iframe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user