Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lexical-utils] Bug Fix: Refactor markSelection for getDOMSlot and not using updateDOM #6961

Merged
merged 3 commits into from
Dec 15, 2024

Conversation

etrepum
Copy link
Collaborator

@etrepum etrepum commented Dec 13, 2024

Description

The usage of updateDOM in markSelection seemed to create DOM churn in certain circumstances for CJK composition inputs which affected user input and selection. Refactoring the function to instead use the invariant that if updateDOM did return true, then the identity of the rendered DOM element would've changed.

While I was in there I also refactored the range code to support the getDOMSlot API. We don't currently have any code that offsets the first child, but if we did then we'd have another bug to fix here.

Closes #6947
Closes #6946

Test plan

Should be covered by existing SelectionAlwaysOnDisplay test coverage

Copy link

vercel bot commented Dec 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lexical ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 14, 2024 6:31pm
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 14, 2024 6:31pm

Copy link

github-actions bot commented Dec 13, 2024

size-limit report 📦

Path Size
lexical - cjs 31.2 KB (0%)
lexical - esm 31.04 KB (0%)
@lexical/rich-text - cjs 40.16 KB (0%)
@lexical/rich-text - esm 32.95 KB (0%)
@lexical/plain-text - cjs 38.77 KB (0%)
@lexical/plain-text - esm 30.16 KB (0%)
@lexical/react - cjs 42.05 KB (0%)
@lexical/react - esm 34.24 KB (0%)

@etrepum etrepum added this pull request to the merge queue Dec 15, 2024
Merged via the queue into facebook:main with commit bf44530 Dec 15, 2024
42 of 43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. extended-tests Run extended e2e tests on a PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: wrong cursor position with CJK keyboard
3 participants