Remove autofocus from full project search when opened via rail tab navigation (#32645)

GitOrigin-RevId: b7ee177e0dc7273c70ca824718ff22b7df190acb
This commit is contained in:
Rebeka Dekany
2026-04-07 13:29:13 +02:00
committed by Copybot
parent 62fa7e9319
commit 7e327ee548

View File

@@ -123,6 +123,12 @@ const FullProjectSearchUI: FC = () => {
const searchInputRef = useRef<HTMLInputElement>(null)
useEffect(() => {
if (!document.activeElement?.closest('.ide-rail')) {
searchInputRef.current?.focus()
}
}, [])
const handleKeyDown: React.KeyboardEventHandler<HTMLElement> = useCallback(
event => {
if (event.key === 'Escape') {
@@ -203,7 +209,6 @@ const FullProjectSearchUI: FC = () => {
name="search"
size="sm"
aria-label={t('search')}
autoFocus // eslint-disable-line jsx-a11y/no-autofocus
spellCheck={false}
autoComplete="off"
ref={searchInputRef}