Просмотр исходного кода

modify the conditional branch for the code block shortcut

WNomunomu 11 месяцев назад
Родитель
Сommit
128f6d189a
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      packages/editor/src/client/stores/use-editor-shortcuts.ts

+ 1 - 1
packages/editor/src/client/stores/use-editor-shortcuts.ts

@@ -142,7 +142,7 @@ const makeCodeBlockExtension: Extension = EditorView.domEventHandlers({
 
     const isModKey = event.ctrlKey || event.metaKey;
 
-    if (event.key.toLowerCase() === 'c' && event.shiftKey && event.altKey && isModKey) {
+    if (event.code === 'KeyC' && event.shiftKey && event.altKey && isModKey) {
       event.preventDefault();
       makeTextCodeBlock(view);
       return true;