Skip to content

Commit

Permalink
fix cusror position while several users are typing
Browse files Browse the repository at this point in the history
  • Loading branch information
erwamartin committed Oct 23, 2023
1 parent ac128ff commit 26e258e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
8 changes: 4 additions & 4 deletions src/plugins/sync-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 26e258e

Please sign in to comment.