You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-29 22:48:10 +02:00
Desktop: Accessibility: Improve note title focus handling (#10932)
This commit is contained in:
@@ -31,6 +31,7 @@ import insertLineAfter from './editorCommands/insertLineAfter';
|
||||
import handlePasteEvent from './utils/handlePasteEvent';
|
||||
import biDirectionalTextExtension from './utils/biDirectionalTextExtension';
|
||||
import searchExtension from './utils/searchExtension';
|
||||
import isCursorAtBeginning from './utils/isCursorAtBeginning';
|
||||
|
||||
const createEditor = (
|
||||
parentElement: HTMLElement, props: EditorProps,
|
||||
@@ -176,12 +177,28 @@ const createEditor = (
|
||||
return true;
|
||||
}),
|
||||
keyCommand('Tab', insertOrIncreaseIndent, true),
|
||||
keyCommand('Shift-Tab', decreaseIndent, true),
|
||||
keyCommand('Shift-Tab', (view) => {
|
||||
// When at the beginning of the editor, allow shift-tab to act
|
||||
// normally.
|
||||
if (isCursorAtBeginning(view.state)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return decreaseIndent(view);
|
||||
}, true),
|
||||
keyCommand('Mod-Enter', (_: EditorView) => {
|
||||
insertLineAfter(_);
|
||||
return true;
|
||||
}, true),
|
||||
|
||||
keyCommand('ArrowUp', (view: EditorView) => {
|
||||
if (isCursorAtBeginning(view.state) && props.onSelectPastBeginning) {
|
||||
props.onSelectPastBeginning();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}, true),
|
||||
|
||||
...standardKeymap, ...historyKeymap, ...searchKeymap,
|
||||
]));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user