From f4a6fe7c2a091525577b0ab3659a15a8538e322b Mon Sep 17 00:00:00 2001 From: Roeland Bosch Date: Mon, 18 May 2020 14:46:33 +0200 Subject: [PATCH] Remove scroll into view be update yjs -> pm Client A places his cursor on a prose mirror field with y-sync. Client keeps the window focused and scroll away from his cursor. Client B (On a different computer) type something in this same prose mirror view. Client A Will be unexpectedly scrolled down to his cursor. --- src/plugins/sync-plugin.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/plugins/sync-plugin.js b/src/plugins/sync-plugin.js index 03af8dc..c0c72e1 100644 --- a/src/plugins/sync-plugin.js +++ b/src/plugins/sync-plugin.js @@ -316,9 +316,6 @@ export class ProsemirrorBinding { let tr = this.prosemirrorView.state.tr.replace(0, this.prosemirrorView.state.doc.content.size, new PModel.Slice(new PModel.Fragment(fragmentContent), 0, 0)) restoreRelativeSelection(tr, this.beforeTransactionSelection, this) tr = tr.setMeta(ySyncPluginKey, { isChangeOrigin: true }) - if (this.beforeTransactionSelection !== null && this.prosemirrorView.hasFocus()) { - tr.scrollIntoView() - } this.prosemirrorView.dispatch(tr) }) }