-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[List v2]: Handle Enter in empty list items #39858
Conversation
Size Change: +474 B (0%) Total Size: 1.22 MB
ℹ️ View Unchanged
|
I like this behaviour :) |
} | ||
event.preventDefault(); | ||
if ( canOutdent ) { | ||
outdentListItem(); |
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.
Shouldn't this be indent?
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.
Why? It's working as expected in the video, no?
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.
For me it was indenting for some reason instead of outdenting.
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.
Looks good to me, but the behaviour seems to be the opposite?
@ntsekouras In a separate PR, can you do the same thing for |
Sweet! :) |
What?
Part of: #39519
Alternative of: #39626
Based on @mtias's suggested algorithm here: #39626 (comment)
Screeny.Video.28.Mar.2022.at.13.50.44.mov
In the experimental new list blocks we should split lists on empty list items if we press enter.
How?
Since my first approach with a different algorithm, the indentation has been implemented by @jorgefilipecosta and I'm using one of the hooks for one of the two parts of the algorithm.
Testing Instructions
Enter
Screenshots or screencast
Screen.Recording.2022-03-29.at.5.41.09.PM.mov
Notes
Enter
in a non empty list item is not handled yet, as it needs more changes involving the RichText API.hooks
file and moveduseIndentListItem and useOutdentListItem
without making any change. The new hook is theuseEnter
one.