Skip to content

Build your personal knowledge base with Trilium Notes

fix(editor): resolve strange stuck indent when a Note has images

perfectra1n51325e2f4a91
diff --git a/packages/ckeditor5/src/plugins/indent_block_shortcut.ts b/packages/ckeditor5/src/plugins/indent_block_shortcut.ts
index 2e65e978c8..5fa2cf0f9e 100644
--- a/packages/ckeditor5/src/plugins/indent_block_shortcut.ts
+++ b/packages/ckeditor5/src/plugins/indent_block_shortcut.ts
@@ -8,21 +8,33 @@ export default class IndentBlockShortcutPlugin extends Plugin {
init() {
this.editor.keystrokes.set( 'Tab', ( _, cancel ) => {
- const command = this.editor.commands.get( 'indentBlock' );
+ // In tables, allow default Tab behavior for cell navigation
+ if (this.isInTable()) {
+ return;
+ }
- if (command && command.isEnabled && !this.isInTable() ) {
+ const command = this.editor.commands.get( 'indentBlock' );
+ if (command?.isEnabled) {
command.execute();
- cancel();
}
+
+ // Always cancel in non-table contexts to prevent widget navigation
+ cancel();
} );
this.editor.keystrokes.set( 'Shift+Tab', ( _, cancel ) => {
- const command = this.editor.commands.get( 'outdentBlock' );
+ // In tables, allow default Shift+Tab behavior for cell navigation
+ if (this.isInTable()) {
+ return;
+ }
- if (command && command.isEnabled && !this.isInTable() ) {
+ const command = this.editor.commands.get( 'outdentBlock' );
+ if (command?.isEnabled) {
command.execute();
- cancel();
}
+
+ // Always cancel in non-table contexts to prevent widget navigation
+ cancel();
} );
}