fix: fixed #81

This commit is contained in:
QiShaoXuan committed 2022-08-04 14:32:52 +08:00
1 parent fbe9add924
commit edf35e44a9
2 files changed
+2 -2

No files matched your search

@@ -148,7 +148,7 @@ const EditorContainer = ({
obv.observe(scrollContainerRef.current); obv.observe(scrollContainerRef.current);
return () => obv.disconnect(); return () => obv.disconnect();
} }
}); }, [setPageClientWidth]);
return ( return (
<StyledEditorContainer <StyledEditorContainer
@@ -30,7 +30,6 @@ export class ScrollManager {
constructor(editor: BlockEditor) { constructor(editor: BlockEditor) {
this._editor = editor; this._editor = editor;
(window as any).scrollManager = this;
} }
private _updateScrollInfo(left: number, top: number) { private _updateScrollInfo(left: number, top: number) {
@@ -111,6 +110,7 @@ export class ScrollManager {
} }
public emitScrollEvent(event: UIEvent) { public emitScrollEvent(event: UIEvent) {
this.scrollContainer = event.target as HTMLElement;
this._scrollDirection = this._getScrollDirection(); this._scrollDirection = this._getScrollDirection();
this._scrollMoveOffset = Math.abs( this._scrollMoveOffset = Math.abs(
this.scrollContainer.scrollTop - this._scrollRecord[0] this.scrollContainer.scrollTop - this._scrollRecord[0]