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. |
📝 WalkthroughWalkthroughThis PR adds automatic viewport scrolling to newly created blocks when splitting blocks with the Enter key. Both the list item handler and keyboard shortcut extension are updated to call ChangesScroll into view on block split
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 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)
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
Summary by CodeRabbit