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

@ -1,6 +1,7 @@
import { useState, useCallback, MutableRefObject, useEffect } from 'react';
import Logger from '@joplin/utils/Logger';
import { SearchMarkers } from './useSearchMarkers';
import { focus } from '@joplin/lib/utils/focusHandler';
const CommandService = require('@joplin/lib/services/CommandService').default;
const logger = Logger.create('useNoteSearchBar');
@ -36,7 +37,7 @@ export default function useNoteSearchBar({ noteSearchBarRef }: UseNoteSearchBarP
useEffect(() => {
if (showLocalSearch && noteSearchBarRef.current) {
noteSearchBarRef.current.focus();
focus('useNoteSearchBar', noteSearchBarRef.current);
}
}, [showLocalSearch, noteSearchBarRef]);