Mobile: Fixes #15120: RTE heading links scroll to bottom instead of top in Editing mode#15128
Mobile: Fixes #15120: RTE heading links scroll to bottom instead of top in Editing mode#15128varunkumar-22 wants to merge 3 commits intolaurent22:devfrom
Conversation
…g to bottom of screen
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdded DOM-based scrolling after ProseMirror selection dispatch: the code now records the matched heading node position and, when a view is available, resolves the heading's DOM element and uses window scrolling to place the heading at the top of the viewport while keeping the existing selection/transaction behavior. Changes
Suggested reviewers
🚥 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 |
|
Please address this comment from Claude: 4. Removing
|
…ader WebView compatibility
|
yeah! I have kept |
|
Still working well with the new approach: Screen.Recording.2026-04-19.at.10.mp4 |
Fixes #15120
Problem
When you tap a heading link in the rich text editor on mobile, the note scrolls but the heading ends up at the bottom of the screen. This is inconsistent with view mode, where the same action brings the heading to the top
Fix
The root cause was that ProseMirror's built-in
scrollIntoView()uses a minimal-scroll strategy ; it only scrolls just enough to make the cursor visible, which naturally pushes the heading to the bottom. The fix grabs the actual heading DOM element usingview.nodeDOM()and calls the nativescrollIntoView({ block: 'start' })on it directly, which is exactly what the view mode doesTest Plan
Tested Manually:
Screen.Recording.2026-04-16.at.10.mp4