1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-13 00:10:37 +02:00

Desktop, Mobile: Improve focus handling

This commit is contained in:
Laurent Cozic
2024-04-01 15:34:22 +01:00
parent 554fb7026a
commit 00084c5798
34 changed files with 119 additions and 92 deletions

View File

@ -14,6 +14,7 @@ import { reg } from '@joplin/lib/registry';
import ResourceFetcher from '@joplin/lib/services/ResourceFetcher';
import DecryptionWorker from '@joplin/lib/services/DecryptionWorker';
import { NoteEntity } from '@joplin/lib/services/database/types';
import { focus } from '@joplin/lib/utils/focusHandler';
export interface OnLoadEvent {
formNote: FormNote;
@ -191,7 +192,7 @@ export default function useFormNote(dependencies: HookDependencies) {
requestAnimationFrame(() => {
if (Setting.value(focusSettingName) === 'title') {
if (titleInputRef.current) titleInputRef.current.focus();
if (titleInputRef.current) focus('useFormNote::handleAutoFocus', titleInputRef.current);
} else {
if (editorRef.current) editorRef.current.execCommand({ name: 'editor.focus' });
}