mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-01 05:11:34 +02:00
Remove autofocus from full project search when opened via rail tab navigation (#32645)
GitOrigin-RevId: b7ee177e0dc7273c70ca824718ff22b7df190acb
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user