Repository navigation
Conversation
An update that runs before the editor has a root element — notably an `$initialEditorState` initializer, or the `editorState` of an initial config — is reconciled to an EditorState only. The DOM selection block is never reached and the update tags are cleared at the end of that commit, so by the time setRootElement reconciles that state into the contenteditable there is no SKIP_DOM_SELECTION_TAG left. Initializing content with $insertNodes therefore moved the DOM selection and scrolled the page to the end of the content even though the tag was set. Remember the request across the un-mounted commit and re-apply the tag on the first commit that has a root element. Fixes meta#8610
LeSingh1
requested review from
acywatson,
etrepum,
fantactuka,
ivailop7,
potatowagon and
zurfyx
as code owners
August 7, 2026 10:00
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An update that runs before the editor has a root element — notably an
$initialEditorStateinitializer, or theeditorStateof an initial config — is reconciled to anEditorStateonly. The DOM-selection block is never reached and the update tags are cleared at the end of that commit, so by the timesetRootElementreconciles that state into the contenteditable there is noSKIP_DOM_SELECTION_TAGleft. Initializing content with$insertNodestherefore moved the DOM selection and scrolled the page to the end of the content even though the tag was set.This remembers the request across the un-mounted commit and re-applies the tag on the first commit that has a root element, so the tag means the same thing during initialization as it does afterwards. The
$setSelection(null)workaround keeps working; the tag's doc comment now describes the mount case.Fixes #8610