BlockNote icon indicating copy to clipboard operation
BlockNote copied to clipboard

SuggestionPlugin and collaboration

Open YousefED opened this issue 9 months ago • 0 comments

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 queryStartPos manually

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

YousefED avatar Feb 24 '25 11:02 YousefED