Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughModified Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
There was a problem hiding this comment.
I'd really prefer not to do this if at all possible. This causes jank for everyone else. I'd prefer something at the read-side (e.g. making the reading of the domElement reactive, or making the component that needs this element on render to remount). But remounting the whole editor is way too much
nperez0111
left a comment
There was a problem hiding this comment.
I'd prefer a different solution here, this is too much. Especially for an issue we can't reliably reproduce
Summary
This PR makes the editor container component re-render when the editor view is mounted. This fixes certain cases where descendants rely on
editor.domElementto be defined. However, when it becomes defined, there is nothing which explicitly triggers a re-render, meaning things like event listeners may not get attached until some other unrelated effect triggers a re-render.Closes #2546
Rationale
See above.
Changes
BlockNoteEditoronMountandonUnmountreturn callbacks to destroy the listeners.BlockNoteViewComponentforce a re-render when the TipTap editor'screateevent fires.Impact
N/A
Testing
I wasn't able to reproduce the issue in #2546 locally, and have not seen other cases of this elsewhere. Therefore, no tests have been added.
Screenshots/Video
N/A
Checklist
Additional Notes
Summary by CodeRabbit
Release Notes