-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
When creating a new check list, set the checked
value of the list item to false
instead of undefined
#5978
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
do u mind updating the description with recordings/screenshots to show no regressions to checklist behavior please?
const listItem = $createListItemNode(); | ||
const listItem = $createListItemNode( | ||
listType === 'check' ? false : undefined, | ||
); |
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.
wondering if its more appropriate to make the handling of this behaviour clearer inside packages/lexical-list/src/LexicalListItemNode.ts
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.
how about now? i've refactored LexicalListItemNode.getChecked()
to always return a boolean if the parent list type is "check"
and undefined otherwise.
packages/lexical-playground/tests/e2e/List.spec.mjs:1170:3 › Nested List › Can create check list, toggle it to bullet-list and back is breaking |
size-limit report 📦
|
…pe changes to bullet or number
Sorry for the long delay. Should be fixed now. |
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.
LGTM, seems reasonable to enforce this and the node transform should keep it consistent
…tem to `false` instead of `undefined` (facebook#5978)
At the moment, when creating a new checklist, the newly created list item doesn't have the
checked
set until the user manually toggles it. This PR makes sure that thechecked
value is set tofalse
and notundefined
.This also makes the behavior in line with the behavior when creating a check list using the markdown transformer.
lexical-checklist.mp4