mirror of
https://github.com/outline/outline.git
synced 2026-06-13 03:14:59 +03:00
fix: Cannot navigate to document out of present mode (#11952)
This commit is contained in:
@@ -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 };
|
||||
|
||||
@@ -331,7 +331,13 @@ function PresentationMode({ title, icon, iconColor, data, onClose }: Props) {
|
||||
</Tooltip>
|
||||
</RightButtons>
|
||||
</TopBar>
|
||||
<SlideArea onClick={goNext}>
|
||||
<SlideArea
|
||||
onClick={(event: React.MouseEvent) => {
|
||||
if (!(event.target as HTMLElement).closest("a")) {
|
||||
goNext();
|
||||
}
|
||||
}}
|
||||
>
|
||||
<SlideContent ref={slideContentRef}>
|
||||
{slide.type === "title" ? (
|
||||
<TitleSlide>
|
||||
@@ -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`
|
||||
|
||||
Reference in New Issue
Block a user