Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Side menu scrolling #1394

Merged
merged 1 commit into from
Jan 27, 2025
Merged

fix: Side menu scrolling #1394

merged 1 commit into from
Jan 27, 2025

Conversation

matthewlipski
Copy link
Collaborator

@matthewlipski matthewlipski commented Jan 27, 2025

This PR fixes the side menu not scrolling with the editor, if the editor is within a scrollable container (works when scrolling document body).

The PR just adds a scroll listener, which is present on all the other UI element plugins. This fixes a regression from #1132.

I spent quite some time playing around with Floating UI to try and get things working without a scroll listener, e.g. by setting contextElement as well as getBoundingClientRect in setReference/setPositionReference. I also tried using autoUpdate, but again had no luck.

I think in general it might be better to keep the scroll listeners though, since it's at least clear in the codebase how those position updates are happening, whereas letting Floating UI handle them makes it less obvious what's going on.

Copy link

vercel bot commented Jan 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
blocknote ✅ Ready (Inspect) Visit Preview Jan 27, 2025 8:23pm
blocknote-website ✅ Ready (Inspect) Visit Preview Jan 27, 2025 8:23pm

@matthewlipski matthewlipski merged commit 4d2fe51 into main Jan 27, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant