Configure Tiptap extension precedence and ordering
mainWhen providing an extensions array to <RichTextEditor extensions={[]} /> or useEditor({ extensions: [] }), the order of extensions matters because it determines keyboard shortcut and event precedence. Extensions that require higher precedence (to intercept events before other plugins) should be placed later in the array.
Recommended Ordering Examples:
- Tables: Place
TableImprovedorTablefirst in the array to ensure it has the lowest precedence (allowing other plugins to handle nested node interactions like list indentation). - Blockquote: Place
BlockquoteafterBoldso that theBlockquoteshortcut (e.g.,Cmd+Shift+B) is not intercepted by theBoldshortcut (Cmd+B). - Mentions: Place
Mentionafter list-related extensions (TaskList,BulletList, etc.) so that pressingEnteron a mention suggestion selects the mention instead of creating a new list item.
// Example of extension ordering
const extensions = [
Table.configure({ ... }), // Lower precedence
Bold,
Blockquote, // Higher precedence
Mention, // Higher precedence
];
// Usage
<RichTextEditor extensions={extensions} />