Skip to content

Commit def0aed

Browse files
committed
fixup! ✨(frontend) document visible in list are now openable via enter key
1 parent f7d516d commit def0aed

File tree

1 file changed

+2
-3
lines changed
  • src/frontend/apps/impress/src/features/docs/docs-grid/components

1 file changed

+2
-3
lines changed

src/frontend/apps/impress/src/features/docs/docs-grid/components/DocsGridItem.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ export const DocsGridItem = ({ doc, dragMode = false }: DocsGridItemProps) => {
2525
const { t } = useTranslation();
2626
const { isDesktop } = useResponsiveStore();
2727
const { flexLeft, flexRight } = useResponsiveDocGrid();
28-
const router = useRouter();
2928
const { spacingsTokens } = useCunninghamTheme();
3029
const shareModal = useModal();
3130
const isPublic = doc.link_reach === LinkReach.PUBLIC;
@@ -39,7 +38,7 @@ export const DocsGridItem = ({ doc, dragMode = false }: DocsGridItemProps) => {
3938
const handleKeyDown = (e: KeyboardEvent) => {
4039
if (e.key === 'Enter' || e.key === ' ') {
4140
e.preventDefault();
42-
void router.push(`/docs/${doc.id}`);
41+
(e.target as HTMLAnchorElement).click();
4342
}
4443
};
4544

@@ -62,7 +61,6 @@ export const DocsGridItem = ({ doc, dragMode = false }: DocsGridItemProps) => {
6261
}
6362
`}
6463
className="--docs--doc-grid-item"
65-
onKeyDown={handleKeyDown}
6664
aria-label={t('Open document: {{title}}', {
6765
title: doc.title || t('Untitled document'),
6866
})}
@@ -82,6 +80,7 @@ export const DocsGridItem = ({ doc, dragMode = false }: DocsGridItemProps) => {
8280
min-width: 0;
8381
`}
8482
href={`/docs/${doc.id}`}
83+
onKeyDown={handleKeyDown}
8584
>
8685
<Box
8786
data-testid={`docs-grid-name-${doc.id}`}

0 commit comments

Comments
 (0)