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

fix: bug-6851 #6854

Closed
wants to merge 1 commit into from
Closed

fix: bug-6851 #6854

wants to merge 1 commit into from

Conversation

emsurezhang
Copy link

#6851

update:
in LexicalSelection.ts file, change the native selection move mode from "extend" to "move", cause isCollapsed is true.
at line 1781:
this.modify('extend', isBackward, 'character'); => this.modify('move', isBackward, 'character');

Copy link

vercel bot commented Nov 21, 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 Nov 21, 2024 3:17pm
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 21, 2024 3:17pm

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 21, 2024
Copy link

size-limit report 📦

Path Size
lexical - cjs 30.94 KB (0%)
lexical - esm 30.8 KB (0%)
@lexical/rich-text - cjs 39.6 KB (0%)
@lexical/rich-text - esm 32.66 KB (0%)
@lexical/plain-text - cjs 38.2 KB (0%)
@lexical/plain-text - esm 29.92 KB (0%)
@lexical/react - cjs 41.37 KB (0%)
@lexical/react - esm 34 KB (0%)

@@ -1778,7 +1778,7 @@ export class RangeSelection implements BaseSelection {
possibleNode.selectStart();
return;
}
this.modify('extend', isBackward, 'character');
this.modify('move', isBackward, 'character');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this change is correct but we can run the tests and see how many will fail. I haven't looked at this code closely recently but I believe the extend is intentional, to grow a collapsed selection by one character and then delete the contents of that selection.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@etrepum etrepum added the stale-pr PRs that are closed due to staleness. Please reopen the PR if there are new updates label Dec 6, 2024
@etrepum
Copy link
Collaborator

etrepum commented Dec 6, 2024

I'm going to close this as stale, since this change does not include tests and causes regressions elsewhere. Please feel free to re-open or create a new PR when you have something that works without regressions.

@etrepum etrepum closed this Dec 6, 2024
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. stale-pr PRs that are closed due to staleness. Please reopen the PR if there are new updates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants