fix(core): call scrollIntoView() on Enter#2802
Conversation
updates the enter handler to scrollintoview both globally and for listItems. Signed-off-by: Wqrld <wereld03@gmail.com>
|
@Wqrld is attempting to deploy a commit to the TypeCell Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughAdds viewport scrolling for newly created blocks when splitting with Enter (both list-item handler and keyboard shortcut). Also exposes a restricted ChangesEnter key scroll behavior
BlockNote editorProps option
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Would you be willing to promote editorprops to something that does not need accessing the internal _tiptapOptions so the margins and maybe other editorprops can be set nicely? (Ref workaround diff in the original issue) |
Summary
Updates the enter handler to scrollintoview both globally and for listItems.
Part of #2801
Rationale
Without this handler, the cursor goes out of frame when pressing enter on the last line in the window
Changes
adds a scrollintoview call for the normal and listitem enter handler
Impact
None expected.
Testing
Tested in the playground environment. Does not overscroll the margins yet as in the demo video.
Screenshots/Video
See referenced issue
Checklist
Additional Notes
There should be support for configuring the margin aswell (see original issue). I can try to add that here or in a separate PR
Disclaimer: Code was AI assisted, but tested by a human and PR text is human.
Summary by CodeRabbit
New Features
Bug Fixes