Skip to content

fix: re-evaluate side-menu on scroll #1830

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

Merged
merged 2 commits into from
Jul 11, 2025
Merged

fix: re-evaluate side-menu on scroll #1830

merged 2 commits into from
Jul 11, 2025

Conversation

nperez0111
Copy link
Contributor

@nperez0111 nperez0111 commented Jul 9, 2025

This attempts to resolve a bug where scrolling with a mouse over an element will keep the block side menu attached to the previous block rather than re-evaluating to the new hovered block.

This makes it more inline with normal hover behavior

Left old behavior, Right new behavior:

Screen.Recording.2025-07-09.at.09.52.52.mp4

Copy link

vercel bot commented Jul 9, 2025

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

Name Status Preview Updated (UTC)
blocknote ✅ Ready (Inspect) Visit Preview Jul 11, 2025 0:15am
blocknote-website ❌ Failed (Inspect) Jul 11, 2025 0:15am

Copy link

pkg-pr-new bot commented Jul 9, 2025

Open in StackBlitz

@blocknote/ariakit

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/ariakit@1830

@blocknote/code-block

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/code-block@1830

@blocknote/core

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/core@1830

@blocknote/mantine

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/mantine@1830

@blocknote/react

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/react@1830

@blocknote/server-util

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/server-util@1830

@blocknote/shadcn

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/shadcn@1830

@blocknote/xl-ai

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-ai@1830

@blocknote/xl-docx-exporter

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-docx-exporter@1830

@blocknote/xl-email-exporter

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-email-exporter@1830

@blocknote/xl-multi-column

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-multi-column@1830

@blocknote/xl-odt-exporter

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-odt-exporter@1830

@blocknote/xl-pdf-exporter

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-pdf-exporter@1830

commit: b4ffeec

@@ -192,6 +192,12 @@ export class SideMenuView<
true,
);

// Update state when the editor scrolls
this.pmView.root.addEventListener(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, though we already attach an existing onScroll handler a few lines below - wouldn't it make more sense to call this.updateStateFromMousePos there instead of creating an additional listener?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't see that one! Very true

@nperez0111 nperez0111 marked this pull request as ready for review July 11, 2025 12:08
@nperez0111 nperez0111 merged commit 0148428 into main Jul 11, 2025
4 of 6 checks passed
@nperez0111 nperez0111 deleted the hover-side-menu branch July 11, 2025 12:08
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.

2 participants