From 26e258e1380baffb8e481aac7cba3ace9c6f16da Mon Sep 17 00:00:00 2001 From: Erwan Martin Date: Mon, 23 Oct 2023 17:44:07 +0200 Subject: [PATCH] fix cusror position while several users are typing --- CHANGELOG.md | 3 +++ package-lock.json | 4 ++-- package.json | 2 +- src/plugins/sync-plugin.js | 8 ++++---- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad91b9f..297ba88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.0.2-napkin] (2023-10-23) +- Revert position changes to fix multiplayer issues + ## [1.0.1-napkin] (2023-10-17) ## Updates diff --git a/package-lock.json b/package-lock.json index 439113c..7c35796 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "y-prosemirror", - "version": "1.0.1-napkin", + "version": "1.0.2-napkin", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "y-prosemirror", - "version": "1.0.1-napkin", + "version": "1.0.2-napkin", "license": "MIT", "dependencies": { "lib0": "^0.2.42" diff --git a/package.json b/package.json index f2e16b3..55800a3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "y-prosemirror", - "version": "1.0.1-napkin", + "version": "1.0.2-napkin", "description": "Prosemirror bindings for Yjs", "main": "./dist/y-prosemirror.cjs", "module": "./src/y-prosemirror.js", diff --git a/src/plugins/sync-plugin.js b/src/plugins/sync-plugin.js index 219d2b9..3e3b6aa 100644 --- a/src/plugins/sync-plugin.js +++ b/src/plugins/sync-plugin.js @@ -236,10 +236,10 @@ const restoreRelativeSelection = (tr, relSel, binding) => { if ( relSel !== null && relSel.anchor !== null && - relSel.head !== null && - // Napkin update: add check for null on item (to prevent random position updates while switching pages) - relSel.anchor.item !== null && - relSel.head.item !== null + relSel.head !== null + // /// Napkin update: add check for null on item (to prevent random position updates while switching pages) + // relSel.anchor.item !== null && + // relSel.head.item !== null ) { const anchor = relativePositionToAbsolutePosition( binding.doc,