Repository navigation
Conversation
…ic move Moving the selection through the node APIs (selectStart, selectEnd, select, selectPrevious, selectNext) repointed the anchor but left format and style holding the values of the old position, so hasFormat and the style helpers kept reporting the formatting of wherever the selection used to be. $internalCreateSelection already re-reads format and style from the anchor whenever a DOM-driven selection change lands on a different node, which is why clicking or arrowing keeps a toolbar in sync. The node select() paths never did, so they were the only way to move a selection and keep stale state. Both TextNode.select and ElementNode.select now run the same refresh, and only when the anchor actually changes node: a format toggled on a collapsed caret is armed for the next insertion rather than backed by the node, so re-selecting the same node must leave it alone. Fixes meta#8817
LeSingh1
requested review from
acywatson,
etrepum,
fantactuka,
ivailop7,
potatowagon and
zurfyx
as code owners
August 7, 2026 09:32
|
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.
Moving the selection through the node APIs (
selectStart,selectEnd,select,selectPrevious,selectNext) repointed the anchor but leftformatandstyleholding the values of the old position, sohasFormatand the style helpers kept reporting the formatting of wherever the selection used to be.$internalCreateSelectionalready re-readsformatandstylefrom the anchor whenever a DOM-driven selection change lands on a different node, which is why clicking or arrowing keeps a toolbar in sync. The nodeselect()paths never did, so they were the only way to move a selection and keep stale state.Both
TextNode.selectandElementNode.selectnow run the same refresh, and only when the anchor actually changes node: a format toggled on a collapsed caret is armed for the next insertion rather than backed by the node, so re-selecting the same node must leave it alone. Tests cover both directions for format and style, plus the two armed-in-place controls.Fixes #8817