Skip to content

fix: allow opening another suggestion menu if another is triggered #1473 #1591

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 3 commits into from
Apr 10, 2025

Conversation

nperez0111
Copy link
Contributor

@nperez0111 nperez0111 commented Apr 7, 2025

This resolves #1473 by allowing the suggestion plugin to switch from one menu to another if it encounters another trigger character

Screen.Recording.2025-04-09.at.10.24.26.mov

This also resolves another issue I ran into personally.

If you type something that ends with : that menu is carried over to the new block, even though it shouldn't here is a video before & after.

Before:

Screen.Recording.2025-04-09.at.10.22.51.mov

After:

Screen.Recording.2025-04-09.at.10.23.42.mov

Copy link

vercel bot commented Apr 7, 2025

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

Name Status Preview Updated (UTC)
blocknote ✅ Ready (Inspect) Visit Preview Apr 9, 2025 0:26am
blocknote-website ✅ Ready (Inspect) Visit Preview Apr 9, 2025 0:26am

Copy link

pkg-pr-new bot commented Apr 7, 2025

Open in StackBlitz

@blocknote/ariakit

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

@blocknote/code-block

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

@blocknote/core

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

@blocknote/mantine

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

@blocknote/react

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

@blocknote/server-util

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

@blocknote/shadcn

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

@blocknote/xl-docx-exporter

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

@blocknote/xl-multi-column

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

@blocknote/xl-odt-exporter

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

@blocknote/xl-pdf-exporter

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

commit: 47d451c

Copy link
Collaborator

@matthewlipski matthewlipski left a comment

Choose a reason for hiding this comment

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

Hmm, I'm wondering while we're at it if we want it to be possible to have multiple suggestion menus to be open, instead of closing the existing one when a new one is opened. Currently, the emoji picker and slash menu clash if they're open together, so I think this would improve the UX.

@nperez0111
Copy link
Contributor Author

nperez0111 commented Apr 9, 2025

@matthewlipski Can two be opened at the same time? Should they both be open at the same time?
Can you show me how you got it to do that?

My understanding is only one should ever be active, and I think that is ideal from a UX standpoint.

@matthewlipski
Copy link
Collaborator

If you type :sm it'll open up the emoji picker, and typing / after will open the slash menu without closing the emoji picker. I've also just noticed that the emoji picker remains open after deleting the query, so this is definitely just a bug.

@nperez0111
Copy link
Contributor Author

Ah good catch @matthewlipski I'll try to resolve that

@nperez0111
Copy link
Contributor Author

Think I got it, abusing the fact that transactions are synchronous

Copy link
Collaborator

@YousefED YousefED left a comment

Choose a reason for hiding this comment

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

nice fixes!

@nperez0111 nperez0111 merged commit 800f7d9 into main Apr 10, 2025
8 checks passed
@nperez0111 nperez0111 deleted the fix/1473 branch April 10, 2025 07:47
Copy link

sentry-io bot commented Apr 10, 2025

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ Error: Attempting to update uninitialized suggestions menu /examples/collaboration/comments View Issue
  • ‼️ Error: Position not found, cannot track positions / View Issue
  • ‼️ TypeError: Cannot read properties of undefined (reading 'id') /examples/collaboration/comments View Issue

Did you find this useful? React with a 👍 or 👎

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.

/ menu not working after a colon
3 participants