Skip to content

fix: Side menu showing when editor isn't focused. #230

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 7 commits into from
Jun 15, 2023

Conversation

matthewlipski
Copy link
Collaborator

@matthewlipski matthewlipski commented Jun 2, 2023

It probably doesn't make sense to show the block side menu if the user hovers a different element that's displayed on top of the editor, since it's distracting to have the side menu moving around when you aren't focused on the editor. See issue #201 for an example of this. This PR makes it so that the side menu is hidden when the mouse hovers an element that is not a descendant of the editor, but is within its bounding box.

Closes #201
Also helps with #185, but doesn't solve the issue completely

@vercel
Copy link

vercel bot commented Jun 2, 2023

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

Name Status Preview Comments Updated (UTC)
blocknote-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 15, 2023 3:03pm

@YousefED
Copy link
Collaborator

YousefED commented Jun 2, 2023

I'm not sure if I agree with this in terms of UX. For example, if I check the preview in https://blocknote-website-git-side-menu-behaviour-change-typecell.vercel.app, when I'm browsing the website, and hovering over the editor, the side menu would normally give me an indication that I can edit the document and / or take certain actions

@matthewlipski
Copy link
Collaborator Author

Do you think adding functions to e.g. force hide the menus would make more sense? I agree that it's nice to have the side menu appear even when the editor isn't focused, but I don't think there's a different condition that it makes sense to use if we automatically want to hide it in cases like #201.

… but the hovered element is not its descendant
@matthewlipski
Copy link
Collaborator Author

matthewlipski commented Jun 12, 2023

Ok so this currently breaks because the side menu itself is not a descendant of the editor. To get the current behaviour, AFAIK the only way to fix this is to make the side menu a descendant of the editor. So fixing #233 will also fix this PR and vice-versa.

UPDATE: Ignore this, I am very stupid

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.

mousemove event kept executed, even when not needed.
2 participants