[Breaking Change][lexical] Bug Fix: Include shadow root in $getReconciledDirection#8479
Merged
Conversation
…tReconciledDirection function
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
etrepum
reviewed
May 8, 2026
etrepum
left a comment
Collaborator
There was a problem hiding this comment.
It looks like this needs changes to test expectations, and it should probably add some new ones to confirm that it's doing the right thing
…ables.spec.mjs" and fix the quotes typo
etrepum
approved these changes
May 8, 2026
etrepum
left a comment
Collaborator
There was a problem hiding this comment.
This seems good to me, although perhaps we should call it out as a breaking change?
Contributor
Author
it might break tests but I don’t think it'd break anything else, so yeah it’s a good idea to point it out. |
Merged
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.
Breaking Change
Since direction reconciliation now affects the root and shadow root nodes consistently, more nodes will have
dir="auto"set when rendered in the editor. While this is expected to only affect behavior in a positive way, if you have tests that snapshot the HTML that the editor renders you may have to adjust them if you are not normalizing for this already.Description
This pull request makes a minor update to the direction reconciliation logic in
LexicalReconciler.tsby replacing the$isRootNodecheck with a more general$isRootOrShadowRootcheck. This ensures that both root and shadow root nodes are handled consistently when determining text direction.$isRootOrShadowRootinstead of$isRootNodewhen checking parent nodes in$getReconciledDirection, improving support for shadow roots. [1] [2]Test plan
Before
After