Skip to content

don't sync selection when the document loses browsing context - #286

Merged
angelaguo merged 2 commits into
mainfrom
dont-sync-selection-no-browsing-context
Sep 29, 2026
Merged

angelaguo merged 2 commits into
mainfrom
dont-sync-selection-no-browsing-context

Conversation

@angelaguo

Copy link
Copy Markdown
Contributor

Some clients are reporting occasional errors when extending the dom selection in setSelection due to view.root.getSelection() returning null. That happens when the document has no browsing context.

This updates useEditor to avoid committing pending effects if there's no browsing context so that we don't run into the setSelection error. It also adds a check that getSelection doesn't return null before explicitly calling setSelection in the one other place we do that.

@angelaguo
angelaguo requested a review from a team as a code owner September 29, 2026 17:36
@angelaguo
angelaguo merged commit 41cd5b3 into main Sep 29, 2026
3 checks passed
@angelaguo
angelaguo deleted the dont-sync-selection-no-browsing-context branch September 29, 2026 17:55
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.

2 participants