BlockNote
BlockNote copied to clipboard
SuggestionPlugin and collaboration
As described by https://github.com/TypeCellOS/BlockNote/issues/1403
In SuggestionPlugin.ts, we depend on queryStartPos. This startPos is not valid anymore after the document has been edited above.
I suppose we could fix this in two ways:
- Store a Yjs position for the selection instead of a Prosemirror-based one
- When Yjs transactions are detected, update
queryStartPosmanually
Note: I was able to reproduce this by disabling transaction.getMeta("blur") (so the menu stays open when you type in a different browser window for testing purposes)
We should also check other places in the codebase where we rely on a stored position in a way that's not compatible with collaborative docs