Skip to content

Set async meta on yCursorPlugin transactions - #34

Merged
juliebarwick merged 1 commit into
masterfrom
set-async-on-ycursor-transaction
Jul 10, 2026
Merged

Set async meta on yCursorPlugin transactions#34
juliebarwick merged 1 commit into
masterfrom
set-async-on-ycursor-transaction

Conversation

@angelaguo

@angelaguo angelaguo commented Jul 10, 2026

Copy link
Copy Markdown

Set metadata on yCursorPlugin transactions to tell react-prosemirror to skip flushSync for them. (Corresponding functionality added to react-prosemirror here). These transactions are consistently firing in between DOM selection updates and the browser firing the corresponding selectionchange event, which is causing selection reversions in Gamma

@angelaguo
angelaguo requested a review from juliebarwick July 10, 2026 18:55
@juliebarwick

Copy link
Copy Markdown

Looks good, but requesting @jamesopti to verify too since this is in such a commonly used file.

Comment thread src/lib.js
metas.forEach((val, key) => {
tr.setMeta(key, val)
})
tr.setMeta('async', true)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM assuming we checked that there isn't a namespace conflict for async currently. I doubt it!

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also checked with @angelaguo and this is only used in the y-cursor plugin so doubly safe.

@juliebarwick
juliebarwick merged commit fc6f103 into master Jul 10, 2026
1 check passed
@juliebarwick
juliebarwick deleted the set-async-on-ycursor-transaction branch July 10, 2026 21:12
juliebarwick added a commit that referenced this pull request Jul 10, 2026
Update our fork version to publish two updates:
- Set an "async" meta to enable react-prosemirror a way to prevent
flushsync for y cursor plugin awareness. This is causing selection
issues in Gamma: #34
- Bring in a fix from upstream y-prosemirror package:
#31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants