1
0
Fork 0
mirror of https://github.com/pawelmalak/flame.git synced 2025-08-04 02:15:18 +02:00

Remove search auto focus

Major annoyance for mobile devices. Mostly tablets that have large keyboards in landscape. You're forced to dismiss the keyboard every time you load the page.
This commit is contained in:
icedterminal 2021-10-21 19:38:52 -07:00 committed by GitHub
parent 6f44200a3c
commit 0fc0ff6c49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,10 +23,6 @@ const SearchBar = (props: ComponentProps): JSX.Element => {
const inputRef = useRef<HTMLInputElement>(document.createElement('input')); const inputRef = useRef<HTMLInputElement>(document.createElement('input'));
useEffect(() => {
inputRef.current.focus();
}, []);
const searchHandler = (e: KeyboardEvent<HTMLInputElement>) => { const searchHandler = (e: KeyboardEvent<HTMLInputElement>) => {
const { isLocal, search, query, isURL, sameTab } = searchParser( const { isLocal, search, query, isURL, sameTab } = searchParser(
inputRef.current.value inputRef.current.value