Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

editor: skip Tab key handling inside tables

Abdullah Atta5b213edae80a
diff --git a/packages/editor/src/extensions/key-map/key-map.ts b/packages/editor/src/extensions/key-map/key-map.ts
index 0e95a8240..a638fcab7 100644
--- a/packages/editor/src/extensions/key-map/key-map.ts
+++ b/packages/editor/src/extensions/key-map/key-map.ts
@@ -18,6 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { Extension } from "@tiptap/core";
+import { isInTable } from "@_ueberdosis/prosemirror-tables";
import { isListActive } from "../../toolbar/utils/prosemirror";
export const KeyMap = Extension.create({
@@ -26,7 +27,7 @@ export const KeyMap = Extension.create({
addKeyboardShortcuts() {
return {
Tab: ({ editor }) => {
- if (isListActive(editor)) return false;
+ if (isListActive(editor) || isInTable(editor.state)) return false;
return editor.commands.insertContent("\t");
}
};