From 47ff32717a209e706b39265fbdc857f398094fe8 Mon Sep 17 00:00:00 2001 From: Sam Wilkins Date: Mon, 15 Apr 2019 18:53:25 -0400 Subject: updated list making and (un)indenting key commands) in prosemirror mapping --- src/client/util/ProsemirrorKeymap.ts | 8 ++++---- src/client/views/nodes/FormattedTextBox.tsx | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/client/util/ProsemirrorKeymap.ts b/src/client/util/ProsemirrorKeymap.ts index 7718b3c06..00d086b97 100644 --- a/src/client/util/ProsemirrorKeymap.ts +++ b/src/client/util/ProsemirrorKeymap.ts @@ -50,10 +50,10 @@ export default function buildKeymap>(schema: S, mapKeys?: } if (type = schema.nodes.bullet_list) { - bind("Shift-Ctrl-8", wrapInList(type)); + bind("Ctrl-b", wrapInList(type)); } if (type = schema.nodes.ordered_list) { - bind("Shift-Ctrl-9", wrapInList(type)); + bind("Ctrl-n", wrapInList(type)); } if (type = schema.nodes.blockquote) { bind("Ctrl->", wrapIn(type)); @@ -74,8 +74,8 @@ export default function buildKeymap>(schema: S, mapKeys?: } if (type = schema.nodes.list_item) { bind("Enter", splitListItem(type)); - bind("Mod-[", liftListItem(type)); - bind("Mod-]", sinkListItem(type)); + bind("Shift-Tab", liftListItem(type)); + bind("Tab", sinkListItem(type)); } if (type = schema.nodes.paragraph) { bind("Shift-Ctrl-0", setBlockType(type)); diff --git a/src/client/views/nodes/FormattedTextBox.tsx b/src/client/views/nodes/FormattedTextBox.tsx index be530416e..7e72c6398 100644 --- a/src/client/views/nodes/FormattedTextBox.tsx +++ b/src/client/views/nodes/FormattedTextBox.tsx @@ -241,6 +241,7 @@ export class FormattedTextBox extends React.Component<(FieldViewProps & Formatte } onKeyPress(e: React.KeyboardEvent) { e.stopPropagation(); + if (e.keyCode === 9) e.preventDefault(); // stop propagation doesn't seem to stop propagation of native keyboard events. // so we set a flag on the native event that marks that the event's been handled. // (e.nativeEvent as any).DASHFormattedTextBoxHandled = true; -- cgit v1.2.3-70-g09d2