fix: docs search box closing too fast (#417)

This commit is contained in:
Daniel Lautzenheiser 2023-01-23 14:43:54 -05:00 committed by GitHub
parent d17378d557
commit 0fd6f823d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 13 deletions

View File

@ -99,7 +99,7 @@ const SearchModal: FC<SearchModalProps> = ({ open, onClose, searchablePages }) =
setCanFocus(true); setCanFocus(true);
setTimeout(() => { setTimeout(() => {
onClose(); onClose();
}); }, 100);
}, [onClose]); }, [onClose]);
const handleSearchChange = useCallback((event: ChangeEvent<HTMLInputElement>) => { const handleSearchChange = useCallback((event: ChangeEvent<HTMLInputElement>) => {

View File

@ -58,24 +58,12 @@ interface SearchResultProps {
const SearchResult = ({ entry: { url, title }, summary, onClick }: SearchResultProps) => { const SearchResult = ({ entry: { url, title }, summary, onClick }: SearchResultProps) => {
const theme = useTheme(); const theme = useTheme();
// const Icon = useMemo(() => {
// switch (type) {
// case NEWS:
// return ArticleIcon;
// case BULLETIN:
// return NewspaperIcon;
// default:
// return WebIcon;
// }
// }, [type]);
return ( return (
<Button <Button
component={Link} component={Link}
href={url} href={url}
key={`result-${url}`} key={`result-${url}`}
onClick={onClick} onClick={onClick}
// startIcon={<Icon fontSize="large" />}
sx={{ sx={{
display: 'flex', display: 'flex',
alignItems: 'flex-start', alignItems: 'flex-start',