fix: fixed #81

This commit is contained in:
QiShaoXuan
2022-08-04 14:32:52 +08:00
parent fbe9add924
commit edf35e44a9
2 changed files with 2 additions and 2 deletions

View File

@@ -148,7 +148,7 @@ const EditorContainer = ({
obv.observe(scrollContainerRef.current);
return () => obv.disconnect();
}
});
}, [setPageClientWidth]);
return (
<StyledEditorContainer

View File

@@ -30,7 +30,6 @@ export class ScrollManager {
constructor(editor: BlockEditor) {
this._editor = editor;
(window as any).scrollManager = this;
}
private _updateScrollInfo(left: number, top: number) {
@@ -111,6 +110,7 @@ export class ScrollManager {
}
public emitScrollEvent(event: UIEvent) {
this.scrollContainer = event.target as HTMLElement;
this._scrollDirection = this._getScrollDirection();
this._scrollMoveOffset = Math.abs(
this.scrollContainer.scrollTop - this._scrollRecord[0]