You've already forked joplin
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:
@ -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]);
|
||||
|
||||
|
Reference in New Issue
Block a user