diff --git a/app/editor/index.tsx b/app/editor/index.tsx index c812e32ec..b810f4316 100644 --- a/app/editor/index.tsx +++ b/app/editor/index.tsx @@ -512,9 +512,13 @@ export class Editor extends React.PureComponent< try { this.mutationObserver?.disconnect(); - this.mutationObserver = observe(hash, (element) => { - element.scrollIntoView({ behavior: "smooth" }); - }); + this.mutationObserver = observe( + hash, + (element) => { + element.scrollIntoView({ behavior: "instant" }); + }, + this.elementRef.current || undefined + ); } catch (err) { // querySelector will throw an error if the hash begins with a number // or contains a period. This is protected against now by safeSlugify diff --git a/app/scenes/Document/components/MultiplayerEditor.tsx b/app/scenes/Document/components/MultiplayerEditor.tsx index e46c7e404..13993c127 100644 --- a/app/scenes/Document/components/MultiplayerEditor.tsx +++ b/app/scenes/Document/components/MultiplayerEditor.tsx @@ -284,6 +284,7 @@ function MultiplayerEditor({ onSynced, ...props }: Props, ref: any) { embedsDisabled={props.embedsDisabled} defaultValue={props.defaultValue} extensions={props.extensions} + scrollTo={props.scrollTo} readOnly ref={ref} />