fix: docs search box closing too fast (#417)
This commit is contained in:
parent
d17378d557
commit
0fd6f823d9
@ -99,7 +99,7 @@ const SearchModal: FC<SearchModalProps> = ({ open, onClose, searchablePages }) =
|
||||
setCanFocus(true);
|
||||
setTimeout(() => {
|
||||
onClose();
|
||||
});
|
||||
}, 100);
|
||||
}, [onClose]);
|
||||
|
||||
const handleSearchChange = useCallback((event: ChangeEvent<HTMLInputElement>) => {
|
||||
|
@ -58,24 +58,12 @@ interface SearchResultProps {
|
||||
const SearchResult = ({ entry: { url, title }, summary, onClick }: SearchResultProps) => {
|
||||
const theme = useTheme();
|
||||
|
||||
// const Icon = useMemo(() => {
|
||||
// switch (type) {
|
||||
// case NEWS:
|
||||
// return ArticleIcon;
|
||||
// case BULLETIN:
|
||||
// return NewspaperIcon;
|
||||
// default:
|
||||
// return WebIcon;
|
||||
// }
|
||||
// }, [type]);
|
||||
|
||||
return (
|
||||
<Button
|
||||
component={Link}
|
||||
href={url}
|
||||
key={`result-${url}`}
|
||||
onClick={onClick}
|
||||
// startIcon={<Icon fontSize="large" />}
|
||||
sx={{
|
||||
display: 'flex',
|
||||
alignItems: 'flex-start',
|
||||
|
Loading…
x
Reference in New Issue
Block a user