[Documentation]: Clear how to overwrite keyboard shortcuts, but not extend them #4002
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: Documentation
The issue or pullrequest is related to documentation
What’s the URL to the page you’re sending feedback for?
https://tiptap.dev/guide/custom-extensions#keyboard-shortcuts
What part of the documentation needs improvement?
Not sure if ultimately I'm misunderstanding, the documentation is lacking, or if this is ultimately a feature request, but while it is clear from the documentation how to overwrite all existing keyboard shortcuts for an extension, it isn't clear how to extend (add to) the keyboard shortcuts or overwrite the behaviour of just one keyboard shortcut.
Take this example:
This listens to
when active inside a
Tab
and insertscodeBlock
.This works fine, only problem is, it overwrites all of the default keyboard shortcuts:
tiptap/packages/extension-code-block/src/code-block.ts
Line 127 in ccf05b0
My preference would be to add
Tab
to that existing list of shortcuts. For other use cases it might be beneficial to extend or overwrite an individual existing keyboard shortcut.Currently - and please tell me I'm wrong 🙂 - it seems I'll have to copy/paste the existing behaviours into my code which is duplicative and doesn't scale well.
What is helpful about that part?
The system for adding keyboard shortcuts is great, and the system for extending extensions as-is is great and documented well enough.
What is hard to understand, missing or misleading?
Expanding this to cover other use cases as mentioned above would be useful.
Anything to add? (optional)
No response
The text was updated successfully, but these errors were encountered: