Skip to content

Commit 8e6b0da

Browse files
fix: Scroll page to where user is editing (#680)
* Fixed incorrect menu position due to `scrollIntoView` * Fixed Enter creating blocks under viewport without scrolling to them * Reverted change to `SideMenuPlugin.ts`
1 parent 1725379 commit 8e6b0da

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/core/src/pm-nodes/BlockContainer.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export const BlockContainer = Node.create<{
139139
state.schema.nodes["blockContainer"].createAndFill()!;
140140

141141
if (dispatch) {
142-
state.tr.insert(pos, newBlock);
142+
state.tr.insert(pos, newBlock).scrollIntoView();
143143
}
144144

145145
return true;
@@ -470,6 +470,8 @@ export const BlockContainer = Node.create<{
470470
)
471471
: undefined
472472
);
473+
474+
state.tr.scrollIntoView();
473475
}
474476

475477
return true;

0 commit comments

Comments
 (0)