diff --git a/app/hooks/useEditorClickHandlers.ts b/app/hooks/useEditorClickHandlers.ts index 9292238502..7e791536d2 100644 --- a/app/hooks/useEditorClickHandlers.ts +++ b/app/hooks/useEditorClickHandlers.ts @@ -14,7 +14,7 @@ type Params = { export default function useEditorClickHandlers({ shareId }: Params) { const history = useHistory(); - const { documents } = useStores(); + const { documents, ui } = useStores(); const handleClickLink = useCallback( (href: string, event?: MouseEvent) => { // on page hash @@ -81,6 +81,7 @@ export default function useEditorClickHandlers({ shareId }: Params) { !event || (!isModKey(event) && !event.shiftKey && event.button !== 1) ) { + ui.setPresentingDocument(null); history.push(navigateTo, { sidebarContext: "collections" }); // optimistic preference of "collections" } else { window.open(navigateTo, "_blank"); @@ -89,7 +90,7 @@ export default function useEditorClickHandlers({ shareId }: Params) { window.open(href, "_blank"); } }, - [history, shareId] + [history, shareId, documents, ui] ); return { handleClickLink }; diff --git a/app/scenes/Document/components/PresentationMode.tsx b/app/scenes/Document/components/PresentationMode.tsx index 312a69a537..106df46c11 100644 --- a/app/scenes/Document/components/PresentationMode.tsx +++ b/app/scenes/Document/components/PresentationMode.tsx @@ -331,7 +331,13 @@ function PresentationMode({ title, icon, iconColor, data, onClose }: Props) { - + { + if (!(event.target as HTMLElement).closest("a")) { + goNext(); + } + }} + > {slide.type === "title" ? ( @@ -395,6 +401,10 @@ const Container = styled.div<{ $background: string; $idle: boolean }>` * { cursor: inherit; } + + a[href] { + cursor: ${(props) => (props.$idle ? "none" : "pointer")}; + } `; const SlideArea = styled.div`