Skip to content

Commit 444c009

Browse files
fix: List item enter handler applying to custom blocks (#571)
* Fixed list enter shortcut applying to custom blocks * Small fix
1 parent d9dffdb commit 444c009

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/core/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ export const handleEnter = (editor: Editor) => {
1010
const selectionEmpty =
1111
editor.state.selection.anchor === editor.state.selection.head;
1212

13-
if (!contentType.name.endsWith("ListItem") || !selectionEmpty) {
13+
if (
14+
!(
15+
contentType.name === "bulletListItem" ||
16+
contentType.name === "numberedListItem"
17+
) ||
18+
!selectionEmpty
19+
) {
1420
return false;
1521
}
1622

0 commit comments

Comments
 (0)