From a24e63d44023adf41dae3d445c9dccfe4fda7104 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Thu, 11 Jan 2024 23:46:01 +1100 Subject: [PATCH] fix(ui): do not focus board search on load --- .../components/Boards/BoardsList/BoardsSearch.tsx | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/BoardsSearch.tsx b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/BoardsSearch.tsx index 67ee4bf54c..5727dc79c0 100644 --- a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/BoardsSearch.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/BoardsSearch.tsx @@ -3,14 +3,13 @@ import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; import { InvIconButton } from 'common/components/InvIconButton/InvIconButton'; import { boardSearchTextChanged } from 'features/gallery/store/gallerySlice'; import type { ChangeEvent, KeyboardEvent } from 'react'; -import { memo, useCallback, useEffect, useRef } from 'react'; +import { memo, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; import { PiXBold } from 'react-icons/pi'; const BoardsSearch = () => { const dispatch = useAppDispatch(); const boardSearchText = useAppSelector((s) => s.gallery.boardSearchText); - const inputRef = useRef(null); const { t } = useTranslation(); const handleBoardSearch = useCallback( @@ -41,18 +40,9 @@ const BoardsSearch = () => { [handleBoardSearch] ); - useEffect(() => { - // focus the search box on mount - if (!inputRef.current) { - return; - } - inputRef.current.focus(); - }, []); - return (