diff --git a/app/editor/components/Styles.ts b/app/editor/components/Styles.ts index 7436a4c45..527c3b94c 100644 --- a/app/editor/components/Styles.ts +++ b/app/editor/components/Styles.ts @@ -548,6 +548,12 @@ const EditorStyles = styled.div<{ cursor: pointer; } + .ProseMirror-focused { + a { + cursor: text; + } + } + a:hover { text-decoration: ${(props) => (props.readOnly ? "underline" : "none")}; } diff --git a/shared/editor/marks/Link.tsx b/shared/editor/marks/Link.tsx index 6fb579327..64611b391 100644 --- a/shared/editor/marks/Link.tsx +++ b/shared/editor/marks/Link.tsx @@ -170,14 +170,14 @@ export default class Link extends Mark { } return false; }, - click: (view, event: MouseEvent) => { + mousedown: (view, event: MouseEvent) => { if (!(event.target instanceof HTMLAnchorElement)) { return false; } // clicking a link while editing should show the link toolbar, // clicking in read-only will navigate - if (!view.editable) { + if (!view.editable || (view.editable && !view.hasFocus())) { const href = event.target.href || (event.target.parentNode instanceof HTMLAnchorElement