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

[Bug]: addKeyboardShortcuts for mod-space/ctrl-space has no effect #4030

Closed
1 of 2 tasks
Nantris opened this issue May 9, 2023 · 1 comment
Closed
1 of 2 tasks

[Bug]: addKeyboardShortcuts for mod-space/ctrl-space has no effect #4030

Nantris opened this issue May 9, 2023 · 1 comment
Assignees
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Triage: Open A new issue or pullrequest that requires triage (added by default) Type: Bug The issue or pullrequest is related to a bug

Comments

@Nantris
Copy link
Contributor

Nantris commented May 9, 2023

Which packages did you experience the bug in?

core

What Tiptap version are you using?

2.0.3

What’s the bug you are facing?

mod-space has no effect in addKeyboardShortcuts:

import { Extension } from '@tiptap/core';
import { keymap } from '@tiptap/pm/keymap';
import { chainCommands, insertText } from '@tiptap/pm/commands';

export const CtrlSpaceExtension = Extension.create({
  name: 'ctrlSpaceExtension',
  addKeyboardShortcuts() {
    return {
      Space: (state, dispatch, view) => {
        console.log('Fires');
      },
      'Mod-e': (state, dispatch, view) => {
        console.log('Fires');
      },
      'Mod-space': (state, dispatch, view) => {
        console.log('Never fires');
      },
    };
  },
});

What browser are you using?

Chrome

Code example

https://codesandbox.io/s/romantic-raman-2xhduu?file=/src/index.js

What did you expect to happen?

mod-space should be usable as a shortcut

Anything to add? (optional)

Perhaps mod- hotkeys are expecting a single character? I can't find where they're processed though.

Character casing doesn't seem to make a difference.

Did you update your dependencies?

  • Yes, I’ve updated my dependencies to use the latest version of all packages.

Are you sponsoring us?

  • Yes, I’m a sponsor. 💖
@Nantris Nantris added Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Triage: Open A new issue or pullrequest that requires triage (added by default) Type: Bug The issue or pullrequest is related to a bug labels May 9, 2023
@Nantris
Copy link
Contributor Author

Nantris commented May 9, 2023

Oh you actually have to use Mod+ which is pretty wonky but at least it works.

@Nantris Nantris closed this as completed May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Triage: Open A new issue or pullrequest that requires triage (added by default) Type: Bug The issue or pullrequest is related to a bug
Projects
None yet
Development

No branches or pull requests

3 participants