BlockNote
BlockNote copied to clipboard
fix: `scrollIntoView` issues
There are 2 issues relating to scrollIntoView
that this PR fixes:
- When the user presses Enter to create a new block, and that block is below the viewport, it's not automatically scrolled to with
scrollIntoView
. - When the user opens a suggestion menu, this is done simultaneously to
scrollIntoView
and results in incorrect positioning of the menu.
TODO: There is still an issue causing #656 to occur due to default browser behaviour scrolling automatically when an element is rendered outside the viewport. In theory, overflow-anchor: none
should fix this when applied to the suggestion menus but I haven't had any luck with it. However, it shouldn't be an issue in the first place if the menu is rendered in the correct position, yet FloatingUI renders it in the old position first before quickly updating it.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Updated (UTC) |
---|---|---|---|
blocknote | ✅ Ready (Inspect) | Visit Preview | May 10, 2024 11:40am |
blocknote-website | ✅ Ready (Inspect) | Visit Preview | May 10, 2024 11:40am |
Possibly related: https://discord.com/channels/928190961455087667/1015169282444894219/1225268041667973243
Possibly related: https://discord.com/channels/928190961455087667/1015169282444894219/1225268041667973243
How to solve this any solution? I am also facing the same.
Possibly related - if you have a tall block with nested children, nesting a new child scrolls you to the top of the nested block, rather than keep the child you've just nested in view.