Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .changelog/2398.trivial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Autofocus search on home page
3 changes: 3 additions & 0 deletions src/app/components/Search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ export interface SearchProps {
disabled?: boolean
onFocusChange?: (hasFocus: boolean) => void
expandable?: boolean
autoFocus?: boolean
}

export const Search: FC<SearchProps> = ({
scope,
expandable,
disabled,
onFocusChange: onFocusChangeProp,
autoFocus,
}) => {
const { t } = useTranslation()
const navigate = useNavigate()
Expand Down Expand Up @@ -86,6 +88,7 @@ export const Search: FC<SearchProps> = ({
)}
size="lg"
onChange={onChange}
autoFocus={autoFocus}
onFocus={() => onFocusChange(true)}
onBlur={() => onFocusChange(false)}
placeholder={searchPlaceholderTranslated}
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/HomePage/HomeSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const HomeSearch: FC = () => {
{t('home.search')}
</Typography>

<Search disabled={!isApiReachable} />
<Search disabled={!isApiReachable} autoFocus />
</div>
)
}
Loading