You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When dynamically adding the ySyncPlugin plugin to an existing editor with a state that doesn't perfectly match the current the Y.XmlFragment state, the ySyncPlugin overrides the editor state to fix this inconsistency (which is expected), and then tries to preserve the user's current selection (here in the code).
This second part can throw an exception if the position is no longer valid for the updated document state.
Click on the button. It will add the ySyncPlugin to the editor's list of plugins.
An out-of-bounds error will be thrown.
Open the console to look at the error.
Expected behavior
When applying your previous selection to the new state, ySyncPlugin should clamp it to the range of valid positions of the new document state, to avoid throwing an error.
Environment Information
"y-prosemirror": "1.2.12"
"yjs": "13.6.20"
The text was updated successfully, but these errors were encountered:
Describe the bug
When dynamically adding the
ySyncPlugin
plugin to an existing editor with a state that doesn't perfectly match the current theY.XmlFragment
state, the ySyncPlugin overrides the editor state to fix this inconsistency (which is expected), and then tries to preserve the user's current selection (here in the code).This second part can throw an exception if the position is no longer valid for the updated document state.
To Reproduce
You can reproduce this error in this stackblitz sandbox.
Steps to reproduce the behavior:
0. Open the link to the reproduction case.
Expected behavior
When applying your previous selection to the new state, ySyncPlugin should clamp it to the range of valid positions of the new document state, to avoid throwing an error.
Environment Information
The text was updated successfully, but these errors were encountered: