Skip to content

Commit

Permalink
Remove scroll into view be update yjs -> pm
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
boschDev authored May 18, 2020
1 parent 17a1f77 commit f4a6fe7
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/plugins/sync-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}
Expand Down

0 comments on commit f4a6fe7

Please sign in to comment.