-
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
[lexical][lexical-list] Bug Fix: Retain indentation when list format is removed and reapplied #6684
[lexical][lexical-list] Bug Fix: Retain indentation when list format is removed and reapplied #6684
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
size-limit report 📦
|
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, can I get a second look from someone please
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 seems like it's probably fine but I would be a lot happier about merging if there was at least one test to show that it does fix the given issue
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.
I can't repro any issues with the tests under react-beta locally, so maybe it's some kind of CI cache issue. Changes look good otherwise!
Description
There is an issue in the lexical-list package where if the user removes the current applied list format, and then reapplies the same (or other) list format, indentation will not be retained. This results in a poor user experience with lists dropping indentation, for simply toggling the list format.
After some debugging, I saw that there was an attempt to handle this behavior within the
$createListOrMerge
method offormatList.ts
, however, the indentation was not being applied in the newly added list nodes.I found that the indentation would be applied to the new list nodes, only if the following invocations are applied after the list is attached to root:
This PR does not close any issue. I realize I should have created an issue prior, and if the team requires this I can do so. Just let me know.
Before
removing_and_reapplying_list_format_looses_indentation_2024-09-28.mp4
After
removing_and_reapplying_list_format_keeps_indentation_2024-09-28.mp4