Skip to content

Commit ece1684

Browse files
fix: Pressing Enter on block without inline content (#1010)
* Made selecting blocks without inline content also focus them when possible * Changed hitting Enter in block without inline content to only create new block below if no modifier keys are held * Revert "Made selecting blocks without inline content also focus them when possible" This reverts commit aa992a6.
1 parent 2d5c3c3 commit ece1684

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/core/src/extensions/NonEditableBlocks/NonEditableBlockPlugin.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,13 @@ export const NonEditableBlockPlugin = () => {
3333
return true;
3434
}
3535
// Checks if key press is Enter
36-
if (event.key === "Enter") {
36+
if (
37+
event.key === "Enter" &&
38+
!event.shiftKey &&
39+
!event.altKey &&
40+
!event.ctrlKey &&
41+
!event.metaKey
42+
) {
3743
const tr = view.state.tr;
3844
view.dispatch(
3945
tr

0 commit comments

Comments
 (0)