-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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] Bug Fix: Fix decorator selection regression with short-circuiting #6508
[lexical] Bug Fix: Fix decorator selection regression with short-circuiting #6508
Conversation
…heck with proper short-circuiting
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
size-limit report 📦
|
const firstElement = firstPoint.getNode() as ElementNode; | ||
if ( | ||
firstPoint.offset === firstElement.getChildrenSize() && | ||
firstElement.is(parentNode) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's imperative that this check is before the next one for short circuiting reasons
const firstPoint = targetSelection.isBackward() | ||
? targetSelection.focus | ||
: targetSelection.anchor; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This gets rid of half the code
Moving back to draft to investigate e2e test failures |
I can't get any of those e2e test to fail locally, I think they might be flaky edit: reran the tests, the flaky failure was in |
Description
The fix in #5948 introduced a crashing regression because the logic doesn't short-circuit when an empty element is encountered.
Closes #6506
Test plan
Before
Crash happens after these conditions:
sample url - must select all after clicking this
example exception
After
Doesn't crash, has more test coverage