fix: Down arrow in search input should move focus to results (#2257)

closes #2253
This commit is contained in:
Tom Moor
2021-07-01 15:01:30 -07:00
committed by GitHub
parent 3c98133e24
commit 7f1322b7ba
4 changed files with 46 additions and 36 deletions

View File

@@ -41,7 +41,7 @@ function replaceResultMarks(tag: string) {
return tag.replace(/<b\b[^>]*>(.*?)<\/b>/gi, "$1");
}
function DocumentListItem(props: Props) {
function DocumentListItem(props: Props, ref) {
const { t } = useTranslation();
const { policies } = useStores();
const currentUser = useCurrentUser();
@@ -68,6 +68,7 @@ function DocumentListItem(props: Props) {
return (
<DocumentLink
ref={ref}
$isStarred={document.isStarred}
$menuOpen={menuOpen}
to={{
@@ -251,4 +252,4 @@ const ResultContext = styled(Highlight)`
margin-bottom: 0.25em;
`;
export default observer(DocumentListItem);
export default observer(React.forwardRef(DocumentListItem));