-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 Item: Avoid an error when the 'onReplace' prop is undefined #48639
Conversation
Size Change: +2 B (0%) Total Size: 1.33 MB
ℹ️ View Unchanged
|
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 looks good, thanks!
Separately from the fix, I'm wondering though if we should consider list-item
as content here.. 🤔 --cc @jorgefilipecosta
We should not consider list-item as content. We should consider the list as content. Otherwise, the content sidebar becomes polluted with every list item as an item and things become less intuitive for the user. |
What?
Fixes #48324.
PR adds a check to avoid an error when the
onReplace
prop isundefined
. Updated behavior matches the Paragraph block - where pressing enter doesn't create a new block.Why?
The
onReplace
method can be undefined based on the block's or its parent's lock state.Testing Instructions
Example markup
Screenshots or screencast
CleanShot.2023-03-01.at.18.06.56.mp4