Remove up/down movement support between page name and content

pull/380/head
Zef Hemel 2023-02-27 15:55:31 +01:00
parent df38a43a1e
commit 41a311d625
2 changed files with 0 additions and 34 deletions

View File

@ -93,22 +93,6 @@ export function TopBar({
return onRename();
}
}}
onKeyUp={(view, event) => {
// When moving cursor down, cancel and move back to editor
if (event.key === "ArrowDown") {
const parent =
(event.target as any).parentElement.parentElement;
// Unless we have autocomplete open
if (
parent.getElementsByClassName("cm-tooltip-autocomplete")
.length === 0
) {
onRename();
return true;
}
}
return false;
}}
completer={completer}
onEnter={(newName) => {
onRename(newName);

View File

@ -691,23 +691,6 @@ export class Editor {
{ selector: "FrontMatter", class: "sb-frontmatter" },
]),
keymap.of([
{
key: "ArrowUp",
run: (view): boolean => {
// When going up while at the top of the document, focus the page name
const selection = view.state.selection.main;
const line = view.state.doc.lineAt(selection.from);
// Are we at the top of the document?
if (line.number === 1) {
// This can be done much nicer, but this is shorter, so... :)
document.querySelector<HTMLDivElement>(
"#sb-current-page .cm-content",
)!.focus();
return true;
}
return false;
},
},
...smartQuoteKeymap,
...closeBracketsKeymap,
...standardKeymap,
@ -786,7 +769,6 @@ export class Editor {
}
},
click: (event: MouseEvent, view: EditorView) => {
console.log("Click handler")
safeRun(async () => {
const clickEvent: ClickEvent = {
page: pageName,