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

Customized SlashMenuItems are not selected correctly when selected with the keyboard #554

Closed
1 task
hyuckkim opened this issue Jan 31, 2024 · 1 comment · Fixed by #609
Closed
1 task
Labels
bug Something isn't working prio:high High priority

Comments

@hyuckkim
Copy link

Describe the bug
My team made two custom blocks and insert to slash menu.

slashMenuItems: [
      ...getDefaultReactSlashMenuItems(),
      insertCheckBoxBlock,
      insertChartBlock,
    ],

insertCheckBoxBlock's group is "Work", and insertChartBlock's group is "Media".
like that:
image

As long as I selected everything with the mouse, there was no problems, but with keyboard, it insert incorrect thing.

I can work around this temporarily by matching the values in your code to the visible values.
like this:

slashMenuItems: [
      ...getDefaultReactSlashMenuItems(),
      insertChartBlock,
      insertCheckBoxBlock,
    ],

However, I am reporting this because it seems clear that this was not intended.

To Reproduce

  1. Make some SlashMenuItem. Group must be "Headings".
    like that:
export const testBlock: ReactSlashMenuItem<
  BlockSchemaWithBlock<"test", typeof CheckBoxBlockSpec.config>
> = {
  name: "test",
  execute: () => {},
  group: "Headings",
  icon: <div />,
}
  1. Insert the Item to slashMenutems.
    like that:
    slashMenuItems: [
      ...getDefaultReactSlashMenuItems(),
      testBlock,
    ],
  1. Move to browser editor and add some 'basic blocks' by slash menu with 'keyboard'.
    pp

Misc

  • Node version: v21.5.0
  • Package manager: npm 10.2.4
  • Browser: edge 121.0.2277.83, but I seems it is not important.
  • I'm a sponsor and would appreciate if you could look into this sooner than later 💖
@hyuckkim hyuckkim added the bug Something isn't working label Jan 31, 2024
@matthewlipski
Copy link
Collaborator

Yep, the slash menu item ordering is indeed a bit wonky atm. We're going through a major overhaul of how the slash menu works to make it easier to add your own suggestion menus like mentions, so we're planning to fix issues like this there (#534 ).

@matthewlipski matthewlipski added the prio:high High priority label Jan 31, 2024
hyuckkim added a commit to hyuckkim/2024-Next.js-project-Daum that referenced this issue Feb 7, 2024
(BlockNote 측에서도 문제 인지해서 대대적으로 개편 예정이라고 함)
TypeCellOS/BlockNote#554
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working prio:high High priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants